Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
df21070e
Commit
df21070e
authored
8 years ago
by
Dan Abramov
Browse files
Options
Download
Email Patches
Plain Diff
Tweak eject output
parent
68d9ff6d
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/react-scripts/scripts/eject.js
+9
-9
packages/react-scripts/scripts/eject.js
with
9 additions
and
9 deletions
+9
-9
packages/react-scripts/scripts/eject.js
+
9
-
9
View file @
df21070e
...
...
@@ -62,9 +62,9 @@ prompt(
fs
.
mkdirSync
(
path
.
join
(
appPath
,
'
scripts
'
));
console
.
log
();
console
.
log
(
'
Copying files to
'
+
cyan
(
appPath
));
console
.
log
(
cyan
(
'
Copying files
in
to
'
+
appPath
));
files
.
forEach
(
function
(
file
)
{
console
.
log
(
'
Copy
ing
'
+
cyan
(
file
));
console
.
log
(
'
Add
ing
'
+
cyan
(
file
)
+
'
to the project
'
);
var
content
=
fs
.
readFileSync
(
path
.
join
(
ownPath
,
file
),
'
utf8
'
)
// Remove dead code from .js files on eject
...
...
@@ -81,9 +81,9 @@ prompt(
var
babelConfig
=
JSON
.
parse
(
fs
.
readFileSync
(
path
.
join
(
ownPath
,
'
.babelrc
'
),
'
utf8
'
));
var
eslintConfig
=
JSON
.
parse
(
fs
.
readFileSync
(
path
.
join
(
ownPath
,
'
.eslintrc
'
),
'
utf8
'
));
console
.
log
(
cyan
(
'
Updating dependencies
...
'
));
console
.
log
(
cyan
(
'
Updating
the
dependencies
'
));
var
ownPackageName
=
ownPackage
.
name
;
console
.
log
(
'
Removing
dependency:
'
+
cyan
(
ownPackageName
));
console
.
log
(
'
Removing
'
+
cyan
(
ownPackageName
)
+
'
from devDependencies
'
);
delete
appPackage
.
devDependencies
[
ownPackageName
];
Object
.
keys
(
ownPackage
.
dependencies
).
forEach
(
function
(
key
)
{
...
...
@@ -91,25 +91,25 @@ prompt(
if
(
ownPackage
.
optionalDependencies
[
key
])
{
return
;
}
console
.
log
(
'
Adding
dependency:
'
+
cyan
(
key
));
console
.
log
(
'
Adding
'
+
cyan
(
key
)
+
'
to devDependencies
'
);
appPackage
.
devDependencies
[
key
]
=
ownPackage
.
dependencies
[
key
];
});
console
.
log
();
console
.
log
(
cyan
(
'
Updating scripts
...
'
));
console
.
log
(
cyan
(
'
Updating
the
scripts
'
));
delete
appPackage
.
scripts
[
'
eject
'
];
Object
.
keys
(
appPackage
.
scripts
).
forEach
(
function
(
key
)
{
appPackage
.
scripts
[
key
]
=
appPackage
.
scripts
[
key
]
.
replace
(
/react-scripts
(\w
+
)
/g
,
'
node scripts/$1.js
'
);
console
.
log
(
'
Replacing
'
+
cyan
(
'
\
"react-scripts
'
+
key
+
'
\
"
'
)
+
cyan
(
'
"react-scripts
'
+
key
+
'
"
'
)
+
'
with
'
+
cyan
(
'
\
"
'
+
appPackage
.
scripts
[
key
]
+
'
\
"
'
)
cyan
(
'
"node
scripts
/
'
+
key
+
'
.js
"
'
)
);
});
console
.
log
();
console
.
log
(
cyan
(
'
Adding configuration to
'
)
+
'
package.json
'
+
cyan
(
'
...
'
));
console
.
log
(
cyan
(
'
Configuring package.json
'
));
// Add Jest config
console
.
log
(
'
Adding
'
+
cyan
(
'
Jest
'
)
+
'
configuration
'
);
appPackage
.
jest
=
createJestConfig
(
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets