Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Only enable external sourcemaps for prod builds (#1811)
Browse files Browse the repository at this point in the history
  • Loading branch information
sliptype committed Aug 29, 2022
1 parent 67e9c2d commit c10ef33
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/web/craco.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from 'webpack'

const isNative = process.env.REACT_APP_NATIVE_NAVIGATION_ENABLED === 'true'
const isProd = process.env.NODE_ENV === 'production'

const SOURCEMAP_URL = 'https://s3.us-west-1.amazonaws.com/sourcemaps.audius.co/'

Expand Down Expand Up @@ -61,10 +62,14 @@ export default {
process: 'process/browser',
Buffer: ['buffer', 'Buffer']
}),
new SourceMapDevToolPlugin({
publicPath: SOURCEMAP_URL,
filename: '[file].map'
})
...(isProd
? [
new SourceMapDevToolPlugin({
publicPath: SOURCEMAP_URL,
filename: '[file].map'
})
]
: [])
],
experiments: {
...config.experiments,
Expand Down

0 comments on commit c10ef33

Please sign in to comment.