From 927c539bc58dd7332175c4928ab25c8087f537a7 Mon Sep 17 00:00:00 2001 From: Joe Haddad <timer150@gmail.com> Date: Mon, 24 Apr 2017 21:51:59 -0400 Subject: [PATCH] Use custom sourcemap file names --- packages/react-scripts/config/webpack.config.dev.js | 4 ++++ packages/react-scripts/config/webpack.config.prod.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/packages/react-scripts/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js index 7244ff796..1822a6166 100644 --- a/packages/react-scripts/config/webpack.config.dev.js +++ b/packages/react-scripts/config/webpack.config.dev.js @@ -11,6 +11,7 @@ 'use strict'; const autoprefixer = require('autoprefixer'); +const path = require('path'); const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); @@ -72,6 +73,9 @@ module.exports = { filename: 'static/js/bundle.js', // This is the URL that app is served from. We use "/" in development. publicPath: publicPath, + // Point sourcemap entries to original disk location + devtoolModuleFilenameTemplate: info => + path.relative(paths.appSrc, info.absoluteResourcePath), }, resolve: { // This allows you to set a fallback for where Webpack should look for modules. diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index a38a98e49..5210cffb1 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -11,6 +11,7 @@ 'use strict'; const autoprefixer = require('autoprefixer'); +const path = require('path'); const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); @@ -71,6 +72,9 @@ module.exports = { chunkFilename: 'static/js/[name].[chunkhash:8].chunk.js', // We inferred the "public path" (such as / or /my-project) from homepage. publicPath: publicPath, + // Point sourcemap entries to original disk location + devtoolModuleFilenameTemplate: info => + path.relative(paths.appSrc, info.absoluteResourcePath), }, resolve: { // This allows you to set a fallback for where Webpack should look for modules. -- GitLab