symlinked the png to decrease start time

master
Malar Kannan 2017-07-18 11:26:42 +05:30
parent 7f41ff4ed2
commit a314e49dbc
2 changed files with 4 additions and 1 deletions

View File

@ -43,6 +43,7 @@ module.exports = {
dotenv: resolveApp('.env'),
appBuild: resolveApp('build'),
appPublic: resolveApp('public'),
appPng: resolveApp('public/png'),
appHtml: resolveApp('public/index.html'),
appIndexJs: resolveApp('src/index.tsx'),
appPackageJson: resolveApp('package.json'),

View File

@ -58,7 +58,9 @@ measureFileSizesBeforeBuild(paths.appBuild)
.then(previousFileSizes => {
// Remove all content but keep the directory so that
// if you're in it, you don't end up in Trash
// fs.copySync
fs.emptyDirSync(paths.appBuild);
fs.ensureSymlink(paths.appPng,path.resolve(paths.appBuild,'png'));
// Merge with the public folder
copyPublicFolder();
// Start the webpack build
@ -148,7 +150,7 @@ function build(previousFileSizes) {
function copyPublicFolder() {
fs.copySync(paths.appPublic, paths.appBuild, {
dereference: true,
filter: file => file !== paths.appHtml,
filter: file => file !== paths.appHtml && file !== paths.appPng,
});
}