client/public: Remove public/ folder and generate it on build
This commit is contained in:
parent
a5a06bf2d1
commit
116919d2a2
8 changed files with 20 additions and 13 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
|||
config.yaml
|
||||
docker-compose.yml
|
||||
*/*_modules/
|
||||
.coverage
|
||||
.cache
|
||||
docker-compose.yml
|
||||
client/public
|
||||
|
|
|
@ -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();
|
||||
|
|
3
client/public/.gitignore
vendored
3
client/public/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
|||
data/
|
||||
manifest.json
|
||||
index.htm
|
2
client/public/css/.gitignore
vendored
2
client/public/css/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
|||
*
|
||||
!.gitignore
|
3
client/public/fonts/.gitignore
vendored
3
client/public/fonts/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
|||
*
|
||||
!open_sans.woff2
|
||||
!.gitignore
|
2
client/public/img/.gitignore
vendored
2
client/public/img/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
|||
*
|
||||
!.gitignore
|
2
client/public/js/.gitignore
vendored
2
client/public/js/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
|||
*
|
||||
!.gitignore
|
Loading…
Reference in a new issue