From bd86026bb95a0fc229124dea1cab362d34b0abfe Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Fri, 28 Oct 2016 15:17:58 +0100 Subject: [PATCH] Change AureliaSpa to use external source maps for compatibility with VS/VSCode debugging --- templates/AureliaSpa/webpack.config.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/templates/AureliaSpa/webpack.config.js b/templates/AureliaSpa/webpack.config.js index 5c0fbe7..cd3cc07 100644 --- a/templates/AureliaSpa/webpack.config.js +++ b/templates/AureliaSpa/webpack.config.js @@ -3,12 +3,12 @@ var path = require('path'); var webpack = require('webpack'); var AureliaWebpackPlugin = require('aurelia-webpack-plugin'); +var bundleOutputDir = './wwwroot/dist'; module.exports = { resolve: { extensions: [ '.js', '.ts' ] }, - devtool: isDevBuild ? 'inline-source-map' : null, entry: { 'app': 'aurelia-bootstrapper-webpack' }, // Note: The aurelia-webpack-plugin will add your app's modules to this bundle automatically output: { - path: path.resolve('./wwwroot/dist'), + path: path.resolve(bundleOutputDir), publicPath: '/dist', filename: '[name].js' }, @@ -30,7 +30,13 @@ module.exports = { src: path.resolve('./ClientApp'), baseUrl: '/' }) - ].concat(isDevBuild ? [] : [ + ].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() ])