Skip to content

Commit bd86026

Browse files
Change AureliaSpa to use external source maps for compatibility with VS/VSCode debugging
1 parent 996216c commit bd86026

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

templates/AureliaSpa/webpack.config.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ var path = require('path');
33
var webpack = require('webpack');
44
var AureliaWebpackPlugin = require('aurelia-webpack-plugin');
55

6+
var bundleOutputDir = './wwwroot/dist';
67
module.exports = {
78
resolve: { extensions: [ '.js', '.ts' ] },
8-
devtool: isDevBuild ? 'inline-source-map' : null,
99
entry: { 'app': 'aurelia-bootstrapper-webpack' }, // Note: The aurelia-webpack-plugin will add your app's modules to this bundle automatically
1010
output: {
11-
path: path.resolve('./wwwroot/dist'),
11+
path: path.resolve(bundleOutputDir),
1212
publicPath: '/dist',
1313
filename: '[name].js'
1414
},
@@ -30,7 +30,13 @@ module.exports = {
3030
src: path.resolve('./ClientApp'),
3131
baseUrl: '/'
3232
})
33-
].concat(isDevBuild ? [] : [
33+
].concat(isDevBuild ? [
34+
// Plugins that apply in development builds only
35+
new webpack.SourceMapDevToolPlugin({
36+
filename: '[file].map', // Remove this line if you prefer inline source maps
37+
moduleFilenameTemplate: path.relative(bundleOutputDir, '[resourcePath]') // Point sourcemap entries to the original file locations on disk
38+
})
39+
] : [
3440
// Plugins that apply in production builds only
3541
new webpack.optimize.UglifyJsPlugin()
3642
])

0 commit comments

Comments
 (0)