-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Description
Multiple specific files (#863) are now supported via config file as of v0.42 (#1389).
Feature request
How about any number of JS files via cli? E.g.:
$ cd src && rollup --output ../dist --watch entry1.js entry2.js entry3.js
dist/entry1.js
dist/entry2.js
dist/entry3.js
This would also work with shell-expanded globs:
$ cd src && rollup --output ../dist --watch *.js
# automatically expanded to:
# cd src && rollup --output ../dist --watch entry1.js entry2.js
Workarounds
Currently, globbing is sort of possible via config file, I think:
// rollup.config.js
const globby = require('globby');
const configs = globby.sync('**/*.js').map(inputFile => ({
entry: inputFile
dest: inputFile.replace('src', 'dist'),
format: 'umd'
}));
module.exports = configs
Via CLI you can use cli-foreachfile
:
cd src && each '**/*.js' -- rollup --output $PWD/../dist/%p $PWD/%p
# --watch supported, but you'll need the `--concurrent` flag on `each`
# cd src && each --concurrent 100 '**/*.js' -- rollup --watch --output $PWD/../dist/%p $PWD/%p
ritz078, zanona, ganlanyuan, paulvonber, rd13 and 18 more