Skip to content

Commit 50b503e

Browse files
committed
Use react-app preset
1 parent 247e598 commit 50b503e

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"presets": ["latest"],
3-
"plugins": ["transform-class-properties"]
2+
"presets": ["react-app"]
43
}

packages/react-scripts/fixtures/kitchensink/.template.dependencies.json

-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"dependencies": {
3-
"babel-preset-latest": "6.16.0",
43
"babel-register": "6.22.0",
54
"babel-polyfill": "6.20.0",
6-
"babel-plugin-transform-class-properties": "6.22.0",
75
"chai": "3.5.0",
86
"jsdom": "9.8.3",
97
"mocha": "3.2.0"

tasks/e2e-kitchensink.sh

+12-3
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ create_react_app --scripts-version=$scripts_path --internal-testing-template=$ro
110110
# Enter the app directory
111111
cd test-kitchensink
112112

113+
# Link to our preset
114+
npm link $root_path/packages/babel-preset-react-app
115+
113116
# Test the build
114-
NODE_PATH=src REACT_APP_SHELL_ENV_MESSAGE=fromtheshell npm run build
117+
NODE_PATH=src NODE_ENV=test REACT_APP_SHELL_ENV_MESSAGE=fromtheshell npm run build
115118
# Check for expected output
116119
test -e build/*.html
117120
test -e build/static/js/main.*.js
@@ -120,24 +123,28 @@ test -e build/static/js/main.*.js
120123
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
121124
CI=true \
122125
NODE_PATH=src \
126+
NODE_ENV=test \
123127
npm test -- --no-cache --testPathPattern="/src/"
124128

125129
# Test "development" environment
126130
tmp_server_log=`mktemp`
127131
PORT=3001 \
128132
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
129133
NODE_PATH=src \
134+
NODE_ENV=development \
130135
nohup npm start &>$tmp_server_log &
131136
grep -q 'The app is running at:' <(tail -f $tmp_server_log)
132137
E2E_URL="http://localhost:3001" \
133138
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
134139
CI=true NODE_PATH=src \
140+
NODE_ENV=development \
135141
node node_modules/.bin/mocha --require babel-register --require babel-polyfill integration/*.test.js
136142

137143
# Test "production" environment
138144
E2E_FILE=./build/index.html \
139145
CI=true \
140146
NODE_PATH=src \
147+
NODE_ENV=production \
141148
node_modules/.bin/mocha --require babel-register --require babel-polyfill integration/*.test.js
142149

143150
# ******************************************************************************
@@ -153,7 +160,7 @@ npm link $root_path/packages/eslint-config-react-app
153160
npm link $root_path/packages/react-dev-utils
154161
npm link $root_path/packages/react-scripts
155162

156-
# ...and we need to remove template's .babelrc
163+
# ...and we need to remove template's .babelrc
157164
rm .babelrc
158165

159166
# Test the build
@@ -166,19 +173,21 @@ test -e build/static/js/main.*.js
166173
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
167174
CI=true \
168175
NODE_PATH=src \
176+
NODE_ENV=test \
169177
npm test -- --no-cache --testPathPattern="/src/"
170178

171179
# Test "development" environment
172180
tmp_server_log=`mktemp`
173181
PORT=3002 \
174182
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
175183
NODE_PATH=src \
184+
NODE_ENV=development \
176185
nohup npm start &>$tmp_server_log &
177186
grep -q 'The app is running at:' <(tail -f $tmp_server_log)
178187
E2E_URL="http://localhost:3002" \
179188
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
180189
CI=true NODE_PATH=src \
181-
NODE_ENV=production \
190+
NODE_ENV=development \
182191
node_modules/.bin/mocha --require babel-register --require babel-polyfill integration/*.test.js
183192

184193
# Test "production" environment

0 commit comments

Comments
 (0)