2017-11-02 5 views
0

コードを変更すると、VSCodeまたはブラウザでアプリケーションを再起動しても変更がブラウザに反映されません。WebPackなどを使用してSPATemplates 2.02でVueとDotNetを使用しています

module.exports = (env) => { 
const isDevBuild = !(env && env.prod); 

return [{ 
    stats: { modules: false }, 
    context: __dirname, 
    resolve: { extensions: [ '.js', '.ts' ] }, 
    entry: { 'main': './ClientApp/boot.ts' }, 
    module: { 
     rules: [ 
      { test: /\.vue\.html$/, include: /ClientApp/, loader: 'vue-loader', options: { loaders: { js: 'awesome-typescript-loader?silent=true' } } }, 
      { test: /\.ts$/, include: /ClientApp/, use: 'awesome-typescript-loader?silent=true' }, 
      { test: /\.css$/, use: isDevBuild ? [ 'style-loader', 'css-loader' ] : ExtractTextPlugin.extract({ use: 'css-loader?minimize' }) }, 
      { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' } 
     ] 
    }, 
    output: { 
     path: path.join(__dirname, bundleOutputDir), 
     filename: '[name].js', 
     publicPath: 'dist/' 
    }, 
    plugins: [ 
     new CheckerPlugin(), 
     new webpack.DefinePlugin({ 
      'process.env': { 
       NODE_ENV: JSON.stringify(isDevBuild ? 'development' : 'production') 
      } 
     }), 
     new webpack.DllReferencePlugin({ 
      context: __dirname, 
      manifest: require('./wwwroot/dist/vendor-manifest.json') 
     }) 
    ].concat(isDevBuild ? [ 
     // Plugins that apply in development builds only 
     new webpack.SourceMapDevToolPlugin({ 
      filename: '[file].map', // Remove this line if you prefer inline source maps 
      moduleFilenameTemplate: path.relative(bundleOutputDir, '[resourcePath]') // Point sourcemap entries to the original file locations on disk 
     }) 
    ] : [ 
     // Plugins that apply in production builds only 
     new webpack.optimize.UglifyJsPlugin(), 
     new ExtractTextPlugin('site.css') 
    ]) 
}]; 

}

答えて

0

これは正常な動作です。変更を適用するには、distフォルダにbundle.jsファイルを再バンドル/再生成して変更を確認し、ブラウザを更新する必要があります。実行することでそれを行うことができます。 webpack webpack.config.js

+0

ありがとうTarikは魅力的です。 – NormanM

関連する問題