Currently, I am working on creating two different vendor bundles using regex expressions in Webpack.
Here is an overview of the contents of my node_modules
directory:
autonumeric
core-js
jquery
jquery-ui
jquery.watch
marked
The first bundle, known as the "essentials" bundle, should include only jquery
and core-js
.
core-js
jquery
For the second bundle, it needs to contain all other packages from the node_modules
directory except for jquery
and core-js
(such as jquery-ui
).
autonumeric
jquery-ui
jquery.watch
marked
These are my current regex patterns:
- Essentials bundle:
/node_modules\/(jquery|core-js)\/.*\.js/
- "Rest-of" bundle:
/node_modules(?!\/(jquery|core-js))(\/[a-zA-Z0-9-_]+)+\.js
The issue lies in the fact that the second regex pattern does not match any libraries starting with jquery*
, possibly due to the negative lookahead clause preceding jquery
.