mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-07 01:41:39 +00:00
update build script
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
// Do this as the first thing so that any code reading it knows the right env.
|
// Do this as the first thing so that any code reading it knows the right env.
|
||||||
process.env.BABEL_ENV = 'production';
|
process.env.BABEL_ENV = 'production';
|
||||||
@@ -40,7 +40,7 @@ const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024;
|
|||||||
const isInteractive = process.stdout.isTTY;
|
const isInteractive = process.stdout.isTTY;
|
||||||
|
|
||||||
// Warn and crash if required files are missing
|
// Warn and crash if required files are missing
|
||||||
//! integrate to django, unneed this step
|
// ! integrate to django, unneed this step
|
||||||
// if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
|
// if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
|
||||||
// process.exit(1);
|
// process.exit(1);
|
||||||
// }
|
// }
|
||||||
@@ -65,7 +65,7 @@ checkBrowsers(paths.appPath, isInteractive)
|
|||||||
// if you're in it, you don't end up in Trash
|
// if you're in it, you don't end up in Trash
|
||||||
fs.emptyDirSync(paths.appBuild);
|
fs.emptyDirSync(paths.appBuild);
|
||||||
// Merge with the public folder
|
// Merge with the public folder
|
||||||
//! seafile: no need do this
|
// ! seafile: no need do this
|
||||||
// copyPublicFolder();
|
// copyPublicFolder();
|
||||||
// Start the webpack build
|
// Start the webpack build
|
||||||
return build(previousFileSizes);
|
return build(previousFileSizes);
|
||||||
@@ -138,6 +138,9 @@ checkBrowsers(paths.appPath, isInteractive)
|
|||||||
function build(previousFileSizes) {
|
function build(previousFileSizes) {
|
||||||
console.log('Creating an optimized production build...');
|
console.log('Creating an optimized production build...');
|
||||||
|
|
||||||
|
const { publicPath, ...rest } = config.output;
|
||||||
|
config.output = rest;
|
||||||
|
|
||||||
const compiler = webpack(config);
|
const compiler = webpack(config);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
compiler.run((err, stats) => {
|
compiler.run((err, stats) => {
|
||||||
|
Reference in New Issue
Block a user