Error in webpack when compiling for Angular 4

Hi I have been trying to migrate from working Angular 2 to Angular 4 for 3 days. The last mistake I hope. The usual solution (

/ angular (\ | /) core (\ | /) @ angular /

) does not solve it.

Mistake:

WARNING in ./~/@angular/core/@angular/core.es5.js
5877:15-36 Critical dependency: the request of a dependency is an expression

WARNING in ./~/@angular/core/@angular/core.es5.js
5893:15-102 Critical dependency: the request of a dependency is an expression

      

I've tried these entries in the webpack.config.vendor.js file one at a time, together and in different orders.

 new webpack.ContextReplacementPlugin(
            /angular(\\|\/)core(\\|\/)@angular/, /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
            helpers.root('../src'),
            {}
        ),// FIx 3


new webpack.ContextReplacementPlugin(/\@angular\b.*\b(bundles|linker)/, path.join(__dirname, './ClientApp')), // Workaround for https://github.com/angular/angular/issues/11580

new webpack.ContextReplacementPlugin(/angular(\\|\/)core(\\|\/)@angular/, path.join(__dirname, './ClientApp')), // Workaround for https://github.com/angular/angular/issues/14898

      

+3


source to share





All Articles