2017-08-09 30 views
0

AOTモードで警告とエラーが発生しました.JITモードでは問題ありません。例えばAOTコンパイルの警告とエラー

最初の警告:

AOTモードでアプリケーションがブラウザで正常に動作しますが、私はこのように、建物の中に警告やエラーメッセージを持ってい

WARNING in ./~/@swimlane/ngx-charts/release/ngx-charts.module.js 
Cannot find source file '../build/ngx-charts.module.ts': Error: Can't resolve '../build/ngx-charts.module.ts' in '/Users/guest/Prive/DevAngular/proto-chartev3-angular/node_modules/@swimlane/ngx-charts/release' 
@ ./aot/src/app/app.module.ngfactory.ts 60:0-70 
@ ./src/main-aot.ts 
@ multi ./src/main-aot 

例えば、最初のエラー:

ERROR in ./~/@swimlane/ngx-charts/release/common/base-chart.component.css 
    Module build failed: Error: "extract-text-webpack-plugin" loader is used without the corresponding plugin, refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example 
     at Object.module.exports.pitch (/Users/guest/Prive/DevAngular/proto-chartev3-angular/node_modules/extract-text-webpack-plugin/loader.js:27:9) 

NGX-チャートバージョン:6.0.1

アンギュラバージョン:4.2.4

WebPACKのバージョン:2.2.1

私が間違っているのか?

答えて

0

ウェブパックの設定に問題があると思います。

// css loader for app styles 
    { 
     test: /\.css$/, 
     exclude: /node_modules/, 
     loader: ExtractTextPlugin.extract({ 
     fallback: 'style-loader', 
     use: [ 
      { loader: 'css-loader', options: { minimize: true } }, 
     ], 
     }), 
    }, 
    // css loader for node_modules to prevent nasty warnings 
    { 
     test: /\.css$/, 
     exclude: path.join(__dirname, 'src/frontend'), 
     use: ['raw-loader', 'sass-loader'], 
    }, 

はあなたstyles.tsのどこかにそれらをインポートする必要がnode_modulesからすべてのスタイルを取得するには:私は、次の抽出・テキストのWebPACK・プラグイン・エラーを解決した

@import '[email protected]/ngx-charts/release/index.css'; 
関連する問題