Skip to content

Commit 7c978e5

Browse files
fsongaearon
authored andcommitted
Use bundled local packages in the end-to-end flow (#721)
Fixes #718.
1 parent fbccb82 commit 7c978e5

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

tasks/cra.sh

+14-4
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,33 @@ clean_path=`mktemp -d 2>/dev/null || mktemp -d -t 'clean_path'`
6161
# Copy some of the react-scripts project files to the temporary folder.
6262
# Exclude folders that definitely won’t be part of the package from processing.
6363
# We will strip the dev-only code there, `npm pack`, and copy the package back.
64-
cd $root_path/packages/react-scripts
64+
cd $root_path
6565
rsync -av --exclude='.git' --exclude=$clean_path\
6666
--exclude='node_modules' --exclude='build'\
6767
'./' $clean_path >/dev/null
6868

6969
# Open the clean folder
70-
cd $clean_path
70+
cd $clean_path/packages/react-scripts
71+
7172
# Now remove all the code relevant to development of Create React App.
7273
files="$(find -L . -name "*.js" -type f)"
7374
for file in $files; do
7475
sed -i.bak '/\/\/ @remove-on-publish-begin/,/\/\/ @remove-on-publish-end/d' $file
7576
rm $file.bak
7677
done
7778

79+
# Install all our packages
80+
cd $clean_path
81+
$root_path/node_modules/.bin/lerna bootstrap
82+
83+
cd $clean_path/packages/react-scripts
84+
85+
# Like bundle-deps, this script modifies packages/react-scripts/package.json,
86+
# copying own dependencies (those in the `packages` dir) to bundledDependencies
87+
node $clean_path/tasks/bundle-own-deps.js
88+
7889
# Finally, pack react-scripts
79-
cp -rf $root_path/packages/react-scripts/node_modules $clean_path
80-
scripts_path=$clean_path/`npm pack`
90+
scripts_path=$clean_path/packages/react-scripts/`npm pack`
8191

8292
# ******************************************************************************
8393
# Now that we have packed them, call the global CLI.

0 commit comments

Comments
 (0)