Skip to content

Commit

Permalink
Properly copy /static directory into /dist output directory.
Browse files Browse the repository at this point in the history
Closes #74
  • Loading branch information
Misterblue committed Feb 1, 2021
1 parent c1676c8 commit 0020502
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build_scripts/cleanDist.js
Expand Up @@ -13,5 +13,5 @@ const fs = require('fs').promises;
const directory = './dist';

fs.rmdir(directory, { recursive: true })
.then(() => console.log('Dist folder cleared!'));
.then(() => console.log('Dist folder cleared!'));

17 changes: 9 additions & 8 deletions build_scripts/copyStatic.js
Expand Up @@ -11,12 +11,13 @@
const fse = require('fs-extra');

const srcDir = `./src/static`;
const destDir = `./dist`;
const destDir = `./dist/static`;

fse.copySync(srcDir, destDir, { overwrite: true }, function (err) {
if (err) {
console.error(err);
} else {
console.log("Successfully copied src/static to dist!");
}
});
try {
fse.mkdirSync(destDir);
fse.copySync(srcDir, destDir, { overwrite: true });
console.log(`Successfully copied ${srcDir} to ${destDir}!`);
}
catch (err) {
console.log(`Failed to copy copied ${srcDir} to ${destDir}!: ${err}`);
};

0 comments on commit 0020502

Please sign in to comment.