重点是: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' } ] } }