Skip to content

Commit b89c31d

Browse files
remove sourcemap in production
1 parent f53a1d5 commit b89c31d

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

config/webpack.config.prod.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ const publicPath = paths.servedPath;
1717
// Some apps do not use client-side routing with pushState.
1818
// For these, "homepage" can be set to "." to enable relative asset paths.
1919
const shouldUseRelativeAssetPaths = publicPath === './';
20-
// Source maps are resource heavy and can cause out of memory issue for large source files.
21-
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
2220
// `publicUrl` is just like `publicPath`, but we will provide it to our app
2321
// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
2422
// Omit trailing slash as %PUBLIC_URL%/xyz looks better than %PUBLIC_URL%xyz.
@@ -50,9 +48,7 @@ const extractTextPluginOptions = shouldUseRelativeAssetPaths
5048
module.exports = {
5149
// Don't attempt to continue if there are any errors.
5250
bail: true,
53-
// We generate sourcemaps in production. This is slow but gives good results.
54-
// You can exclude the *.map files from the build during deployment.
55-
devtool: shouldUseSourceMap ? 'source-map' : false,
51+
devtool: false,
5652
// In production, we only want to load the polyfills and the app code.
5753
entry: [require.resolve('./polyfills'), paths.appIndexJs],
5854
output: {
@@ -180,7 +176,7 @@ module.exports = {
180176
options: {
181177
importLoaders: 1,
182178
minimize: true,
183-
sourceMap: shouldUseSourceMap,
179+
sourceMap: false,
184180
},
185181
},
186182
{
@@ -227,7 +223,7 @@ module.exports = {
227223
options: {
228224
importLoaders: 1,
229225
minimize: true,
230-
sourceMap: shouldUseSourceMap,
226+
sourceMap: false,
231227
},
232228
},
233229
{
@@ -308,7 +304,7 @@ module.exports = {
308304
// https://github.com/facebookincubator/create-react-app/issues/2488
309305
ascii_only: true,
310306
},
311-
sourceMap: shouldUseSourceMap,
307+
sourceMap: false,
312308
}),
313309
// Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.
314310
new ExtractTextPlugin({

src/App.styl

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
padding-top 50px
44

55
.string-container, .fret-index
6-
width 80%
6+
width 95%
7+
max-width 1300px
78
margin 0 auto
89
display flex
910

0 commit comments

Comments
 (0)