mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-19 06:10:56 +08:00
feat(webpack): add --env.stats to disable printing stats
primarily used internally by preview-cli
This commit is contained in:

committed by
Nathan Walker

parent
eedc9c9eb1
commit
e80ec07873
@ -56,6 +56,7 @@ program
|
||||
env['env'] = options.env;
|
||||
}
|
||||
|
||||
env['stats'] ??= true;
|
||||
env['watch'] ??= options.watch;
|
||||
|
||||
// if --env.config is passed, we'll set an environment
|
||||
@ -108,13 +109,15 @@ program
|
||||
// Set the process exit code depending on errors
|
||||
process.exitCode = stats.hasErrors() ? 1 : 0;
|
||||
|
||||
console.log(
|
||||
stats.toString({
|
||||
chunks: false,
|
||||
colors: true,
|
||||
errorDetails: env.verbose,
|
||||
})
|
||||
);
|
||||
if (env.stats) {
|
||||
console.log(
|
||||
stats.toString({
|
||||
chunks: false,
|
||||
colors: true,
|
||||
errorDetails: env.verbose,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
// if webpack profile is enabled we write the stats to a JSON file
|
||||
if (configuration.profile || env.profile) {
|
||||
@ -141,7 +144,7 @@ program
|
||||
};
|
||||
|
||||
if (options.watch) {
|
||||
console.log('webpack is watching the files...');
|
||||
env.stats && console.log('webpack is watching the files...');
|
||||
compiler.watch(
|
||||
configuration.watchOptions ?? {},
|
||||
webpackCompilationCallback
|
||||
|
Reference in New Issue
Block a user