mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-29 01:45:40 +08:00
add check to filter out custom scripts in eject command (#2562)
This commit is contained in:
committed by
Dan Abramov
parent
41f2013260
commit
0644e80d36
3
packages/react-scripts/scripts/eject.js
vendored
3
packages/react-scripts/scripts/eject.js
vendored
@@ -169,6 +169,9 @@ inquirer
|
||||
Object.keys(appPackage.scripts).forEach(key => {
|
||||
Object.keys(ownPackage.bin).forEach(binKey => {
|
||||
const regex = new RegExp(binKey + ' (\\w+)', 'g');
|
||||
if (!regex.test(appPackage.scripts[key])) {
|
||||
return;
|
||||
}
|
||||
appPackage.scripts[key] = appPackage.scripts[key].replace(
|
||||
regex,
|
||||
'node scripts/$1.js'
|
||||
|
||||
Reference in New Issue
Block a user