|
@@ -15,11 +15,16 @@ const compile = () => {
|
|
|
throw new Error('Config set to fail on warning, exiting with status code "1".');
|
|
|
}
|
|
|
debug('Copying static assets to dist folder.');
|
|
|
- fs.copySync(paths.client('static'), paths.dist());
|
|
|
- fs.copySync(paths.client('assets'), paths.dist('assets'));
|
|
|
- fs.copySync(paths.project('static'), paths.dist());
|
|
|
- fs.copySync(paths.project('assets'), paths.dist('assets'));
|
|
|
- fs.copySync(paths.lib(), paths.dist());
|
|
|
+ if (fs.existsSync(paths.client('static')))
|
|
|
+ fs.copySync(paths.client('static'), paths.dist());
|
|
|
+ if (fs.existsSync(paths.client('assets')))
|
|
|
+ fs.copySync(paths.client('assets'), paths.dist('assets'));
|
|
|
+ if (fs.existsSync(paths.project('static')))
|
|
|
+ fs.copySync(paths.project('static'), paths.dist());
|
|
|
+ if (fs.existsSync(paths.project('assets')))
|
|
|
+ fs.copySync(paths.project('assets'), paths.dist('assets'));
|
|
|
+ if (fs.existsSync(paths.lib()))
|
|
|
+ fs.copySync(paths.lib(), paths.dist());
|
|
|
})
|
|
|
.then(() => {
|
|
|
debug('Compilation completed successfully.');
|