Skip to content

Commit a3eacd6

Browse files
committed
Fix source map warning from react-devtools
1 parent 727b627 commit a3eacd6

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

scripts/patch-modules.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const shell = require('shelljs')
2+
const path = require('path')
3+
4+
console.log('Patch react-devtools-core')
5+
6+
const rdStandalone = path.join(
7+
__dirname,
8+
'../dist/node_modules/react-devtools-core/dist/standalone.js',
9+
)
10+
11+
// Avoid source map not found war
12+
shell.sed(
13+
'-i',
14+
/sourceMappingURL=importFile\.worker\.worker\.js\.map'\]\)\),\{name:"\[name\]\.worker\.js/g,
15+
`sourceMappingURL_NotUsed=importFile.worker.worker.js.map'])),{name:"ReactDevToolsImportFile.worker.js`,
16+
rdStandalone,
17+
)

scripts/postinstall.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ async function run() {
1515
'-rf',
1616
'node_modules/apollo-client-devtools/{assets,build,development,shells/dev,src}',
1717
)
18+
// eslint-disable-next-line
19+
require('./patch-modules')
1820
}
1921

2022
run()

0 commit comments

Comments
 (0)