Angular Ivy compiler and webpack
Ivy is not yet officially released. With version 8 of Angular you can opt into the preview with the CLI.
See: https://blog.angular.io/a-plan-for-version-8-0-and-ivy-b3318dfc19f7
Angular should be fully switched over to Ivy in version 9. You'll likely find more documentation on using Ivy with a custom webpack config then.
Until then I would suggest either of the following:
- Open a new issue on the Angular Builders repository and ask this question there. Angular builders is the go-to
ng eject
alternative and they will likely have more answers than the average joe on stack overflow when it comes to this kinds of issue. - Open an issue on the Angular repository and ask this question there.
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
]
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.
Ivy is still in preview mode. If you want to try to follow the steps from the screenshot below,
It is mentioned in the official documentation, https://angular.io/guide/ivy#using-ivy-in-an-existing-project