Build angular2 application using webpack - cannot find. / Compiler.es5.ts

I am using webpack to create an angular2 application. after updating angular2 from 2.3.1 to 4.0.1, the web package displays the following Warning:

WARNING in ./~/@angular/compiler/@angular/compiler.es5.js
Cannot find source file 'compiler.es5.ts': Error: Can't resolve 
'./compiler.es5.ts' in '../node_modules\@angular\compiler\@angular'
@ ./~/@angular/platform-browser-dynamic/@angular/platform-browser-dynamic.es5.js 11:0-72

The message is correct, because in this place there is no such file with the extension ts, the file exists, but has the extension js.

Do I have a webpack configuration value?

By the way: I do not see a warning if I use @ angular / cli v1.0 to create an application.

+6
source share
2 answers

A similar issue is reported at https://github.com/angular-redux/store/issues/64

exclude -map-loader webpack.config.js.

{
        test: /\.(js|ts)$/,
        exclude: [
            // workaround for this issue
            path.join(__dirname, 'node_modules', '@angular/compiler')
        ],
        use: [{
            loader: 'source-map-loader'
        }],
        enforce: 'pre'
}

.

+9

Source: https://habr.com/ru/post/1016470/


All Articles