-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf71040
commit c65d38c
Showing
5 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ src/*.css | |
|
||
## dist files | ||
dist/ | ||
build/ | ||
|
||
## Karma code coverage reports | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const fs = require('fs'); | ||
const bundle = 'auro-button__bundled.js'; | ||
const indexFile = './build/index.html'; | ||
|
||
// File destination.txt will be created or overwritten by default. | ||
let copyFiles = async function() { | ||
fs.copyFile(`./dist/${bundle}`, `./build/${bundle}`, (err) => { | ||
if (err) throw err; | ||
console.log(`${bundle} was copied to ./build dir`); | ||
}); | ||
|
||
fs.copyFile(`./demo/css/style.css`, `./build/css/style.css`, (err) => { | ||
if (err) throw err; | ||
console.log(`CSS was copied to ./build dir`); | ||
}); | ||
} | ||
|
||
// Edit string in new index.html file | ||
fs.readFile(indexFile, 'utf8', function (err,data) { | ||
copyFiles(); | ||
|
||
if (err) { | ||
return console.log(err); | ||
} | ||
|
||
const element = data.replace(`../src/auro-button.js`, `auro-button__bundled.js`); | ||
|
||
fs.writeFile(indexFile, element, 'utf8', function (err) { | ||
if (err) return console.log(err); | ||
}); | ||
}); |