Skip to content

pwang2/webpack-require-context-swallow-exit-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ABOUT

webpack require context will give warning on any syntax error.

Prerequisites

make sure have webpack installed gloablly and just open terminal type > webpack to build

Reproduce Steps

  1. add a syntax error in util.js require by index.js directly will fail webpack build with exit code 2.
ERROR in ./util.js
Module parse failed: /Users/pwang/Works/webpack-require-context-swallow-exit-code/util.js Unexpected token (3:2)
You may need an appropriate loader to handle this file type.
| export default {
|   a: 1
|   b: 2
| };
|
 @ ./index.js 1:0-29
 @ multi ./index.js
  1. fix added error, then add a syntax error in mod1.js loaded by require.context will always give exit code 0 and gives just a WARNING.
WARNING in ./src/mod1.js
Module parse failed: /Users/pwang/Works/webpack-require-context-swallow-exit-code/src/mod1.js Unexpected token (1:2)
You may need an appropriate loader to handle this file type.
| I know you will fail
|
 @ ./src ^\.\/.*$
 @ ./index.js
 @ multi ./index.js

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published