【发布时间】:2019-08-26 16:59:55
【问题描述】:
我一直在 Angular 应用程序中使用 devextreme,但在制作 prod build 时,它占用了更大的尺寸。所以,我想使用 ngx-build-plus 和 webpack 忽略插件将它从 prod 构建中排除,但它不排除。
-
我尝试使用带有 webpack.extras.js 的 ngx-build-plus,它不排除。
module.exports = { "externals": { "rxjs": "rxjs", "@angular/core": "ng.core", "@angular/common": "ng.common", "@angular/platform-browser": "ng.platformBrowser", "devextreme" : "devextreme", "devexpress-diagram": "devexpress-diagram", "devextreme-schematics": "devextreme-schematics", "devextreme-angular": "devextreme-angular", } } -
我尝试使用 webpack 忽略插件来排除它,我看到错误与 api 方案不匹配。
发生未处理的异常:配置对象无效。 Webpack 已使用与 API 模式不匹配的配置对象进行初始化。 - configuration.externals['plugins'][0] 应该是一个字符串。
module.exports = { "externals": { "rxjs": "rxjs", "@angular/core": "ng.core", "@angular/common": "ng.common", "@angular/platform-browser": "ng.platformBrowser", "plugins":[ new webpack.IgnorePlugin(/devextreme/) ] } }
它应该从 prod 构建中排除 devextreme。如果有任何解决方案,请告诉我。
【问题讨论】:
标签: angular webpack devextreme devextreme-angular