Skip to content
  • Sponsor facebook/create-react-app

  • Notifications You must be signed in to change notification settings
  • Fork 27k

Commit 927c539

Browse files
committedApr 25, 2017
Use custom sourcemap file names
1 parent 5bb502a commit 927c539

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
 

‎packages/react-scripts/config/webpack.config.dev.js

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
'use strict';
1212

1313
const autoprefixer = require('autoprefixer');
14+
const path = require('path');
1415
const webpack = require('webpack');
1516
const HtmlWebpackPlugin = require('html-webpack-plugin');
1617
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
@@ -72,6 +73,9 @@ module.exports = {
7273
filename: 'static/js/bundle.js',
7374
// This is the URL that app is served from. We use "/" in development.
7475
publicPath: publicPath,
76+
// Point sourcemap entries to original disk location
77+
devtoolModuleFilenameTemplate: info =>
78+
path.relative(paths.appSrc, info.absoluteResourcePath),
7579
},
7680
resolve: {
7781
// This allows you to set a fallback for where Webpack should look for modules.

‎packages/react-scripts/config/webpack.config.prod.js

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
'use strict';
1212

1313
const autoprefixer = require('autoprefixer');
14+
const path = require('path');
1415
const webpack = require('webpack');
1516
const HtmlWebpackPlugin = require('html-webpack-plugin');
1617
const ExtractTextPlugin = require('extract-text-webpack-plugin');
@@ -71,6 +72,9 @@ module.exports = {
7172
chunkFilename: 'static/js/[name].[chunkhash:8].chunk.js',
7273
// We inferred the "public path" (such as / or /my-project) from homepage.
7374
publicPath: publicPath,
75+
// Point sourcemap entries to original disk location
76+
devtoolModuleFilenameTemplate: info =>
77+
path.relative(paths.appSrc, info.absoluteResourcePath),
7478
},
7579
resolve: {
7680
// This allows you to set a fallback for where Webpack should look for modules.

0 commit comments

Comments
 (0)