mirror of https://github.com/alibaba/ice.git
chore: assets output in build (#59)
This commit is contained in:
parent
6b5d56bc15
commit
3a579259e4
|
|
@ -44,6 +44,19 @@ async function webpackCompiler(options: {
|
||||||
});
|
});
|
||||||
const messages = formatWebpackMessages(statsData);
|
const messages = formatWebpackMessages(statsData);
|
||||||
const isSuccessful = !messages.errors.length && !messages.warnings.length;
|
const isSuccessful = !messages.errors.length && !messages.warnings.length;
|
||||||
|
if (isSuccessful && !process.env.DISABLE_STATS) {
|
||||||
|
const assetsStatsOptions = {
|
||||||
|
errors: false,
|
||||||
|
warnings: false,
|
||||||
|
colors: true,
|
||||||
|
assets: true,
|
||||||
|
chunks: false,
|
||||||
|
entrypoints: false,
|
||||||
|
modules: false,
|
||||||
|
timings: false,
|
||||||
|
};
|
||||||
|
consola.log(stats.toString(assetsStatsOptions));
|
||||||
|
}
|
||||||
if (messages.errors.length) {
|
if (messages.errors.length) {
|
||||||
// Only keep the first error. Others are often indicative
|
// Only keep the first error. Others are often indicative
|
||||||
// of the same problem, but confuse the reader with noise.
|
// of the same problem, but confuse the reader with noise.
|
||||||
|
|
|
||||||
|
|
@ -49,22 +49,9 @@ const plugin: Plugin = ({ registerTask, context, onHook, registerCliOption, regi
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
onHook('after.start.compile', ({ urls, stats, messages }) => {
|
onHook('after.start.compile', ({ urls, messages }) => {
|
||||||
// 包含错误时不打印 localUrl 和 assets 信息
|
// 包含错误时不打印 localUrl 和 assets 信息
|
||||||
if (!messages.errors.length) {
|
if (!messages.errors.length) {
|
||||||
if (!commandArgs.disableAssets) {
|
|
||||||
console.log(stats.toString({
|
|
||||||
errors: false,
|
|
||||||
warnings: false,
|
|
||||||
colors: true,
|
|
||||||
assets: true,
|
|
||||||
chunks: false,
|
|
||||||
entrypoints: false,
|
|
||||||
modules: false,
|
|
||||||
timings: false,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
console.log(chalk.green(' Starting the development server at:'));
|
console.log(chalk.green(' Starting the development server at:'));
|
||||||
if (process.env.CLOUDIDE_ENV) {
|
if (process.env.CLOUDIDE_ENV) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue