Closed
Description
I think it would be really useful to support wildcards in webpack entry points, like this:
entry: "test/**/*Spec.js"
My use case here is to be able to find all tests in a directory without having to add them to a master index.js. This should work with watch mode as well so that new/removed/changed files in matching the glob would be automatically picked up.
I can work around this by using gulp or grunt to watch for the glob and pipe them into webpack, but it feels a bit awkward.
Activity
sokra commentedon Jul 23, 2014
You can easily do this by your own, as the webpack.config.js is just a node.js module and allows to execute any code.
wmertens commentedon Jun 13, 2015
@sokra could this be reopened? If wildcards are supported out of the box more people will know how to use them, and the watch functionality can detect new files...
SgtPooki commentedon Jul 24, 2015
+1 for wildcard support.
wildcard support would allow config file to be json, or put into package.json
Phoenixmatrix commentedon Sep 4, 2015
@sokra there's another use case for wildcard entry points: not needing to restart webpack -watch when a new file is added. We have a lot of entry points for various reasons (eg: being able to run unit tests on a smaller subset of the files during development), and whenever someone adds a new test file, they'd have to restart webpack for it to get picked up, while everything else is handled by -watch.
adamkdean commentedon Nov 13, 2015
+1
kilianc commentedon Dec 18, 2015
+1
kilianc commentedon Dec 18, 2015
@sokra this is mostly for the CLI not the config file, as you said the config file is fine and using
glob.sync
just works.missingtrailingcomma commentedon Dec 27, 2015
+1
stevenjlho commentedon Jan 14, 2016
+1
ixisio commentedon Jan 14, 2016
+1
cspotcode commentedon Jan 15, 2016
A possible workaround is to use
require.context
:jrhorn424 commentedon Jan 26, 2016
Thanks @cspotcode. 👍 🌟
wip: もう一歩前へ
54 remaining items