diff --git a/templates/Angular2Spa/project.json b/templates/Angular2Spa/project.json index f717415..39d5802 100755 --- a/templates/Angular2Spa/project.json +++ b/templates/Angular2Spa/project.json @@ -60,6 +60,9 @@ "Views", "web.config", "wwwroot" + ], + "exclude": [ + "wwwroot/dist/*.map" ] }, diff --git a/templates/Angular2Spa/webpack.config.js b/templates/Angular2Spa/webpack.config.js index 6199f68..b4285a3 100644 --- a/templates/Angular2Spa/webpack.config.js +++ b/templates/Angular2Spa/webpack.config.js @@ -23,9 +23,10 @@ var sharedConfig = { }; // Configuration for client-side bundle suitable for running in browsers +var clientBundleOutputDir = './wwwroot/dist'; var clientBundleConfig = merge(sharedConfig, { entry: { 'main-client': './ClientApp/boot-client.ts' }, - output: { path: path.join(__dirname, './wwwroot/dist') }, + output: { path: path.join(__dirname, clientBundleOutputDir) }, plugins: [ new webpack.DllReferencePlugin({ context: __dirname, @@ -33,7 +34,10 @@ var clientBundleConfig = merge(sharedConfig, { }) ].concat(isDevBuild ? [ // Plugins that apply in development builds only - new webpack.SourceMapDevToolPlugin({ moduleFilenameTemplate: '../../[resourcePath]' }) // Compiled output is at './wwwroot/dist/', but sources are relative to './' + new webpack.SourceMapDevToolPlugin({ + filename: '[name].js.map', // Remove this line if you prefer inline source maps + moduleFilenameTemplate: path.relative(clientBundleOutputDir, '[resourcePath]') // Point sourcemap entries to the original file locations on disk + }) ] : [ // Plugins that apply in production builds only new webpack.optimize.OccurenceOrderPlugin(), diff --git a/templates/KnockoutSpa/project.json b/templates/KnockoutSpa/project.json index 38aa423..24a35e1 100755 --- a/templates/KnockoutSpa/project.json +++ b/templates/KnockoutSpa/project.json @@ -59,6 +59,9 @@ "Views", "web.config", "wwwroot" + ], + "exclude": [ + "wwwroot/dist/*.map" ] }, diff --git a/templates/KnockoutSpa/webpack.config.js b/templates/KnockoutSpa/webpack.config.js index eaa1d24..16f5998 100644 --- a/templates/KnockoutSpa/webpack.config.js +++ b/templates/KnockoutSpa/webpack.config.js @@ -3,11 +3,12 @@ var path = require('path'); var webpack = require('webpack'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); +var bundleOutputDir = './wwwroot/dist'; module.exports = { entry: { 'main': './ClientApp/boot.ts' }, resolve: { extensions: [ '', '.js', '.ts' ] }, output: { - path: path.join(__dirname, './wwwroot/dist'), + path: path.join(__dirname, bundleOutputDir), filename: '[name].js', publicPath: '/dist/' }, @@ -26,7 +27,10 @@ module.exports = { }) ].concat(isDevBuild ? [ // Plugins that apply in development builds only - new webpack.SourceMapDevToolPlugin({ moduleFilenameTemplate: '../../[resourcePath]' }) // Compiled output is at './wwwroot/dist/', but sources are relative to './' + new webpack.SourceMapDevToolPlugin({ + filename: '[name].js.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.OccurenceOrderPlugin(), diff --git a/templates/ReactReduxSpa/project.json b/templates/ReactReduxSpa/project.json index 5811e72..a6bb0e3 100755 --- a/templates/ReactReduxSpa/project.json +++ b/templates/ReactReduxSpa/project.json @@ -60,6 +60,9 @@ "Views", "web.config", "wwwroot" + ], + "exclude": [ + "wwwroot/dist/*.map" ] }, diff --git a/templates/ReactReduxSpa/webpack.config.js b/templates/ReactReduxSpa/webpack.config.js index 72d40bb..748f568 100644 --- a/templates/ReactReduxSpa/webpack.config.js +++ b/templates/ReactReduxSpa/webpack.config.js @@ -22,6 +22,7 @@ var sharedConfig = () => ({ }); // Configuration for client-side bundle suitable for running in browsers +var clientBundleOutputDir = './wwwroot/dist'; var clientBundleConfig = merge(sharedConfig(), { entry: { 'main-client': './ClientApp/boot-client.tsx' }, module: { @@ -30,7 +31,7 @@ var clientBundleConfig = merge(sharedConfig(), { { test: /\.(png|jpg|jpeg|gif|svg)$/, loader: 'url', query: { limit: 25000 } } ] }, - output: { path: path.join(__dirname, './wwwroot/dist') }, + output: { path: path.join(__dirname, clientBundleOutputDir) }, plugins: [ new ExtractTextPlugin('site.css'), new webpack.DllReferencePlugin({ @@ -39,7 +40,10 @@ var clientBundleConfig = merge(sharedConfig(), { }) ].concat(isDevBuild ? [ // Plugins that apply in development builds only - new webpack.SourceMapDevToolPlugin({ moduleFilenameTemplate: '../../[resourcePath]' }) // Compiled output is at './wwwroot/dist/', but sources are relative to './' + new webpack.SourceMapDevToolPlugin({ + filename: '[name].js.map', // Remove this line if you prefer inline source maps + moduleFilenameTemplate: path.relative(clientBundleOutputDir, '[resourcePath]') // Point sourcemap entries to the original file locations on disk + }) ] : [ // Plugins that apply in production builds only new webpack.optimize.OccurenceOrderPlugin(), diff --git a/templates/ReactSpa/project.json b/templates/ReactSpa/project.json index b44ec25..88da8ca 100755 --- a/templates/ReactSpa/project.json +++ b/templates/ReactSpa/project.json @@ -59,6 +59,9 @@ "Views", "web.config", "wwwroot" + ], + "exclude": [ + "wwwroot/dist/*.map" ] }, diff --git a/templates/ReactSpa/webpack.config.js b/templates/ReactSpa/webpack.config.js index 3f63ccf..6bd8e3d 100644 --- a/templates/ReactSpa/webpack.config.js +++ b/templates/ReactSpa/webpack.config.js @@ -3,12 +3,13 @@ var path = require('path'); var webpack = require('webpack'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); +var bundleOutputDir = './wwwroot/dist'; module.exports = { devtool: isDevBuild ? 'inline-source-map' : null, entry: { 'main': './ClientApp/boot.tsx' }, resolve: { extensions: [ '', '.js', '.jsx', '.ts', '.tsx' ] }, output: { - path: path.join(__dirname, './wwwroot/dist'), + path: path.join(__dirname, bundleOutputDir), filename: '[name].js', publicPath: '/dist/' }, @@ -27,7 +28,10 @@ module.exports = { }) ].concat(isDevBuild ? [ // Plugins that apply in development builds only - new webpack.SourceMapDevToolPlugin({ moduleFilenameTemplate: '../../[resourcePath]' }) // Compiled output is at './wwwroot/dist/', but sources are relative to './' + new webpack.SourceMapDevToolPlugin({ + filename: '[name].js.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.OccurenceOrderPlugin(), diff --git a/templates/WebApplicationBasic/project.json b/templates/WebApplicationBasic/project.json index 1f055c1..cbafb51 100755 --- a/templates/WebApplicationBasic/project.json +++ b/templates/WebApplicationBasic/project.json @@ -56,6 +56,9 @@ "Views", "web.config", "wwwroot" + ], + "exclude": [ + "wwwroot/dist/*.map" ] }, diff --git a/templates/WebApplicationBasic/webpack.config.dev.js b/templates/WebApplicationBasic/webpack.config.dev.js index 3a50a8a..8c7d9e1 100644 --- a/templates/WebApplicationBasic/webpack.config.dev.js +++ b/templates/WebApplicationBasic/webpack.config.dev.js @@ -2,6 +2,10 @@ var webpack = require('webpack'); module.exports = { plugins: [ - new webpack.SourceMapDevToolPlugin({ moduleFilenameTemplate: '../../[resourcePath]' }) // Compiled output is at './wwwroot/dist/', but sources are relative to './' + // Plugins that apply in development builds only + new webpack.SourceMapDevToolPlugin({ + filename: '[name].js.map', // Remove this line if you prefer inline source maps + moduleFilenameTemplate: path.relative('./wwwroot/dist', '[resourcePath]') // Point sourcemap entries to the original file locations on disk + }) ] };