mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-25 11:07:29 +00:00
Make source maps compatible with VS/VSCode debugging (fix file paths, and strip out the "charset=utf-8;" segments from inline sourceMappingURLs)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
var isDevBuild = process.argv.indexOf('--env.prod') < 0;
|
||||
var path = require('path');
|
||||
var webpack = require('webpack');
|
||||
var SourceMapDevToolPlugin = require('aspnet-webpack').SourceMapDevToolPlugin;
|
||||
var nodeExternals = require('webpack-node-externals');
|
||||
var merge = require('webpack-merge');
|
||||
var allFilenamesExceptJavaScript = /\.(?!js(\?|$))([^.]+(\?|$))/;
|
||||
@@ -26,13 +27,15 @@ var sharedConfig = {
|
||||
var clientBundleConfig = merge(sharedConfig, {
|
||||
entry: { 'main-client': './ClientApp/boot-client.ts' },
|
||||
output: { path: path.join(__dirname, './wwwroot/dist') },
|
||||
devtool: isDevBuild ? 'inline-source-map' : null,
|
||||
plugins: [
|
||||
new webpack.DllReferencePlugin({
|
||||
context: __dirname,
|
||||
manifest: require('./wwwroot/dist/vendor-manifest.json')
|
||||
})
|
||||
].concat(isDevBuild ? [] : [
|
||||
].concat(isDevBuild ? [
|
||||
// Plugins that apply in development builds only
|
||||
new SourceMapDevToolPlugin({ moduleFilenameTemplate: '../../[resourcePath]' }) // Compiled output is at './wwwroot/dist/', but sources are relative to './'
|
||||
] : [
|
||||
// Plugins that apply in production builds only
|
||||
new webpack.optimize.OccurenceOrderPlugin(),
|
||||
new webpack.optimize.UglifyJsPlugin()
|
||||
|
||||
Reference in New Issue
Block a user