diff options
| author | Shyam Sunder <sgsunder1@gmail.com> | 2018-09-04 21:10:51 -0400 |
|---|---|---|
| committer | rr- <rr-@sakuya.pl> | 2018-12-22 12:31:25 +0100 |
| commit | 116919d2a2caaad544c15fcdcb69f61820828c84 (patch) | |
| tree | 6f81ce97750bb19fda9a09a17be277a0d214664f /client/build.js | |
| parent | a5a06bf2d10b2a2e16ae3e91cf119c56cb050532 (diff) | |
client/public: Remove public/ folder and generate it on build
Diffstat (limited to 'client/build.js')
| -rwxr-xr-x | client/build.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/client/build.js b/client/build.js index dd63a5f..ce91b8d 100755 --- a/client/build.js +++ b/client/build.js @@ -203,7 +203,9 @@ function bundleConfig() { function bundleBinaryAssets() { fs.copyFileSync('./img/favicon.png', './public/img/favicon.png'); fs.copyFileSync('./img/transparency_grid.png', './public/img/transparency_grid.png'); + console.info('Copied Images'); + fs.copyFileSync('./fonts/open_sans.woff2', './public/fonts/open_sans.woff2') for (let file of glob.sync('./node_modules/font-awesome/fonts/*.*')) { if (fs.lstatSync(file).isDirectory()) { continue; @@ -255,8 +257,24 @@ function bundleWebAppFiles() { }); } +function makeOutputDirs() { + const dirs = [ + './public', + './public/css', + './public/fonts', + './public/img', + './public/js' + ]; + for (let dir of dirs) { + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir, 0o755); + } + } +} + // ------------------------------------------------- +makeOutputDirs(); bundleConfig(); bundleBinaryAssets(); bundleWebAppFiles(); |