@@ -228,6 +228,25 @@ function verify_env_url {
228
228
mv package.json.orig package.json
229
229
}
230
230
231
+ function verify_module_scope {
232
+ # Create stub json file
233
+ echo " {}" >> sample.json
234
+
235
+ # Save App.js, we're going to modify it
236
+ cp src/App.js src/App.js.bak
237
+
238
+ # Add an out of scope import
239
+ echo " import sampleJson from '../sample'" | cat - src/App.js > src/App.js.temp && mv src/App.js.temp src/App.js
240
+
241
+ # Make sure the build fails
242
+ npm run build; test $? -eq 1 || exit 1
243
+ # TODO: check for error message
244
+
245
+ # Restore App.js
246
+ rm src/App.js
247
+ mv src/App.js.bak src/App.js
248
+ }
249
+
231
250
# Enter the app directory
232
251
cd test-app
233
252
@@ -251,6 +270,9 @@ npm start -- --smoke-test
251
270
# Test environment handling
252
271
verify_env_url
253
272
273
+ # Test reliance on webpack internals
274
+ verify_module_scope
275
+
254
276
# ******************************************************************************
255
277
# Finally, let's check that everything still works after ejecting.
256
278
# ******************************************************************************
@@ -287,5 +309,8 @@ npm start -- --smoke-test
287
309
# Test environment handling
288
310
verify_env_url
289
311
312
+ # Test reliance on webpack internals
313
+ verify_module_scope
314
+
290
315
# Cleanup
291
316
cleanup
0 commit comments