ste*_*ers 6 webpack angular angular-builder angular-ivy
我们想将新的Angular 8 Ivy编译器与webpack一起使用。我们不使用Angular CLI。这可能吗?如何才能做到这一点?我似乎找不到有关此要求的信息。
To learn what to do you have to dig into Angular CLI code and see where exactly they use enableIvy flag.
I haven't seen your Webpack config but I guess you're using AngularCompilerPlugin.
If this is the case then you have to provide it with enableIvy in compilerOptions.
For more details look here (where the flag is defined), here (where the plugin options are defined) and here (where plugin's compilerOptions are initialized).
The plugin configuration will probably look like this:
... // The rest of your webpack config
plugins: [
new AngularCompilerPlugin({
compilerOptions: {
enableIvy: true,
...// the rest of compiler options
}
...// The rest of options you provide to AngularCompilerPlugin
})
...// The rest of your plugins
]
Run Code Online (Sandbox Code Playgroud)
I'm not sure if they are using this flag in other places but this place is a must and it will probably give you what you want.
In any case if you want to save yourself a headache I'd recommend you to stick with Angular CLI.
Otherwise you'll have to visit their code base quite often.
If you're using Webpack then most probably it is possible to do what you need with Angular CLI and Custom Webpack Builder.
If you're having a hard time configuring the builder you're more than welcome to visit Angular Builders Slack channel.
| 归档时间: |
|
| 查看次数: |
614 次 |
| 最近记录: |