client/public: Remove public/ folder and generate it on build

This commit is contained in:
Shyam Sunder 2018-09-04 21:10:51 -04:00 committed by rr-
parent a5a06bf2d1
commit 116919d2a2
8 changed files with 20 additions and 13 deletions

3
.gitignore vendored
View file

@ -1,5 +1,6 @@
config.yaml
docker-compose.yml
*/*_modules/
.coverage
.cache
docker-compose.yml
client/public

View file

@ -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();

View file

@ -1,3 +0,0 @@
data/
manifest.json
index.htm

View file

@ -1,2 +0,0 @@
*
!.gitignore

View file

@ -1,3 +0,0 @@
*
!open_sans.woff2
!.gitignore

View file

@ -1,2 +0,0 @@
*
!.gitignore

View file

@ -1,2 +0,0 @@
*
!.gitignore