wszgrcy / angular-miniprogram

使用Angular开发小程序
https://wszgrcy.github.io/angular-miniprogram/
MIT License
205 stars 20 forks source link

bug: 无法打包为生产模式 #1

Closed HyperLife1119 closed 3 years ago

HyperLife1119 commented 3 years ago

重现步骤: 执行 ng build --configuration production --aot --build-optimizer

[error] TypeError: Cannot create property 'chunks' on boolean 'false'
    at WebpackConfigurationChange.<anonymous> (xxx\angular-miniprogram-template\node_modules\angular-miniprogram\builder\webpack-configuration-change.js:99:64)
    at Generator.next (<anonymous>)
    at fulfilled (xxx\angular-miniprogram-template\node_modules\angular-miniprogram\builder\webpack-configuration-change.js:24:58)
HyperLife1119 commented 3 years ago

是打开了 buildOptimizer 导致的

wszgrcy commented 3 years ago

是打开了 buildOptimizer 导致的

image 你可以先通过修改这个配置使打包成功 目前正常情况下,只需要添加vendorChunk即可,但是我修改了下全局样式的后缀,导致了和ng计算包大小警告的那个插件有冲突,可以先把配置删了跑起来,我再排除下原因

wszgrcy commented 3 years ago

https://github.com/wszgrcy/angular-miniprogram/commit/1acec341e839d9032289b33ab6f231d432bf180c https://github.com/wszgrcy/angular-miniprogram-template/commit/fcea5705d2adc643d97a070e4eb2bfa780f762e9