Add support for public/ folder (#703)

This commit is contained in:
Dan Abramov
2016-09-22 21:25:34 +01:00
committed by GitHub
parent 5b85a3624f
commit bc6392afaf
14 changed files with 202 additions and 122 deletions

View File

@@ -13,7 +13,7 @@
process.env.NODE_ENV = 'production';
var chalk = require('chalk');
var fs = require('fs');
var fs = require('fs-extra');
var path = require('path');
var filesize = require('filesize');
var gzipSize = require('gzip-size').sync;
@@ -70,6 +70,9 @@ recursive(paths.appBuild, (err, fileNames) => {
// Start the webpack build
build(previousSizeMap);
// Merge with the public folder
copyPublicFolder();
});
// Print a detailed summary of build files.
@@ -175,3 +178,10 @@ function build(previousSizeMap) {
}
});
}
function copyPublicFolder() {
fs.copySync(paths.appPublic, paths.appBuild, {
dereference: true,
filter: file => file !== paths.appHtml
});
}