From 116919d2a2caaad544c15fcdcb69f61820828c84 Mon Sep 17 00:00:00 2001 From: Shyam Sunder Date: Tue, 4 Sep 2018 21:10:51 -0400 Subject: client/public: Remove public/ folder and generate it on build --- client/build.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'client/build.js') 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(); -- cgit v1.3