Commit 86a0ccf9 authored by 邓晓峰's avatar 邓晓峰

fix webpack packages

parent 1d61fbbc
...@@ -11,30 +11,32 @@ const spinner = ora('building for production...'); ...@@ -11,30 +11,32 @@ const spinner = ora('building for production...');
// const Diff = require('diff'); // const Diff = require('diff');
spinner.start() spinner.start()
rm(argv.releasepath ? path.resolve(argv.releasepath, pkg.name.toLocaleLowerCase()): `./${pkg.name.toLocaleLowerCase()}`, err => { // rm(argv.releasepath ? path.resolve(argv.releasepath, pkg.name.toLocaleLowerCase()): `./${pkg.name.toLocaleLowerCase()}`, err => {
// if (err) throw err
// })
webpack(webpackConfig, function (err, stats) {
spinner.stop()
if (err) throw err if (err) throw err
webpack(webpackConfig, function (err, stats) { process.stdout.write(stats.toString({
spinner.stop() colors: true,
if (err) throw err color: true,
process.stdout.write(stats.toString({ progress: true,
colors: true, modules: false,
color: true, children: false,
progress: true, chunks: true,
modules: false, chunkModules: true
children: false, }) + '\n\n')
chunks: true,
chunkModules: true
}) + '\n\n')
if (stats.hasErrors()) { if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n')) console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1) process.exit(1)
} }
console.log(chalk.cyan(' Build complete.\n')) console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow( console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' + ' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n' ' Opening index.html over file:// won\'t work.\n'
)) ))
}) })
}) \ No newline at end of file
...@@ -18,28 +18,28 @@ var argv = require('../../server/argv'); ...@@ -18,28 +18,28 @@ var argv = require('../../server/argv');
var spinner = ora('building for production...'); // const Diff = require('diff'); var spinner = ora('building for production...'); // const Diff = require('diff');
spinner.start(); spinner.start(); // rm(argv.releasepath ? path.resolve(argv.releasepath, pkg.name.toLocaleLowerCase()): `./${pkg.name.toLocaleLowerCase()}`, err => {
rm(argv.releasepath ? path.resolve(argv.releasepath, pkg.name.toLocaleLowerCase()) : "./".concat(pkg.name.toLocaleLowerCase()), function (err) { // if (err) throw err
// })
webpack(webpackConfig, function (err, stats) {
spinner.stop();
if (err) throw err; if (err) throw err;
webpack(webpackConfig, function (err, stats) { process.stdout.write(stats.toString({
spinner.stop(); colors: true,
if (err) throw err; color: true,
process.stdout.write(stats.toString({ progress: true,
colors: true, modules: false,
color: true, children: false,
progress: true, chunks: true,
modules: false, chunkModules: true
children: false, }) + '\n\n');
chunks: true,
chunkModules: true if (stats.hasErrors()) {
}) + '\n\n'); console.log(chalk.red(' Build failed with errors.\n'));
process.exit(1);
if (stats.hasErrors()) { }
console.log(chalk.red(' Build failed with errors.\n'));
process.exit(1); console.log(chalk.cyan(' Build complete.\n'));
} console.log(chalk.yellow(' Tip: built files are meant to be served over an HTTP server.\n' + ' Opening index.html over file:// won\'t work.\n'));
console.log(chalk.cyan(' Build complete.\n'));
console.log(chalk.yellow(' Tip: built files are meant to be served over an HTTP server.\n' + ' Opening index.html over file:// won\'t work.\n'));
});
}); });
\ No newline at end of file
...@@ -44,6 +44,10 @@ const render = () => { ...@@ -44,6 +44,10 @@ const render = () => {
MOUNT_NODE, MOUNT_NODE,
); );
}; };
const loader = (appContent, loading) => render({ appContent, loading }); const loader = (appContent, loading) => render({ appContent, loading });
const initLocale = () => { const initLocale = () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment