diff --git a/packages/taro-cli/templates/default/config/prod b/packages/taro-cli/templates/default/config/prod index 3910355420b3..c6a1531337f2 100644 --- a/packages/taro-cli/templates/default/config/prod +++ b/packages/taro-cli/templates/default/config/prod @@ -5,5 +5,14 @@ module.exports = { defineConstants: { }, weapp: {}, - h5: {} + h5: { + /** + * 如果h5端编译后体积过大,可以使用webpack-bundle-analyzer插件对打包体积进行分析。 + * 参考代码如下: + * webpackChain (chain) { + * chain.plugin('analyzer') + * .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, []) + * } + */ + } } diff --git a/packages/taro-cli/templates/mobx/config/prod b/packages/taro-cli/templates/mobx/config/prod index 3910355420b3..c6a1531337f2 100644 --- a/packages/taro-cli/templates/mobx/config/prod +++ b/packages/taro-cli/templates/mobx/config/prod @@ -5,5 +5,14 @@ module.exports = { defineConstants: { }, weapp: {}, - h5: {} + h5: { + /** + * 如果h5端编译后体积过大,可以使用webpack-bundle-analyzer插件对打包体积进行分析。 + * 参考代码如下: + * webpackChain (chain) { + * chain.plugin('analyzer') + * .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, []) + * } + */ + } } diff --git a/packages/taro-cli/templates/redux/config/prod b/packages/taro-cli/templates/redux/config/prod index 3910355420b3..c6a1531337f2 100644 --- a/packages/taro-cli/templates/redux/config/prod +++ b/packages/taro-cli/templates/redux/config/prod @@ -5,5 +5,14 @@ module.exports = { defineConstants: { }, weapp: {}, - h5: {} + h5: { + /** + * 如果h5端编译后体积过大,可以使用webpack-bundle-analyzer插件对打包体积进行分析。 + * 参考代码如下: + * webpackChain (chain) { + * chain.plugin('analyzer') + * .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, []) + * } + */ + } } diff --git a/packages/taro-cli/templates/wxcloud/client/config/prod b/packages/taro-cli/templates/wxcloud/client/config/prod index 3910355420b3..c6a1531337f2 100644 --- a/packages/taro-cli/templates/wxcloud/client/config/prod +++ b/packages/taro-cli/templates/wxcloud/client/config/prod @@ -5,5 +5,14 @@ module.exports = { defineConstants: { }, weapp: {}, - h5: {} + h5: { + /** + * 如果h5端编译后体积过大,可以使用webpack-bundle-analyzer插件对打包体积进行分析。 + * 参考代码如下: + * webpackChain (chain) { + * chain.plugin('analyzer') + * .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, []) + * } + */ + } }