vscode debugger for chrome 調試webpack的配置問題


重點是:devtoolModuleFilenameTemplate這個配置項

module.exports = {
  entry: './app.ts',
  output: {
    filename: 'bundle.js',
    publicPath: '/assets',
    devtoolModuleFilenameTemplate: '../[resource-path]'
  },
  resolve: {
    // Add `.ts` and `.tsx` as a resolvable extension.
    extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js']
  },
  devtool: 'source-map',
  devServer: {
  },
  module: {
    loaders: [
      // all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
      { test: /\.tsx?$/, loader: 'ts-loader!source-map-loader' },
      { test: /\.html$/, loader: 'raw-loader'                  }
    ]
  }
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM