-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Support multiple configs/bundles in parallel #1389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple configs/bundles in parallel #1389
Conversation
This is how I manually handle #372 until there is a better solution in Rollup internals. |
This is great, thank you! Even works in |
Here's a pattern some may wish to use to leverage this feature to produce minified bundles without duplicating config: import uglify from 'rollup-plugin-uglify'
import { minify } from 'uglify-es'
const activeConfigs = [ /* array of rollup config objects */ ]
const minifiedConfigs = activeConfigs.reduce(
(minifiedConfigs, activeConfig) => minifiedConfigs.concat(
Object.assign({}, activeConfig, {
plugins: [uglify({}, minify), ...activeConfig.plugins],
dest: activeConfig.dest.replace('js', 'min.js')
})
),
[]
)
export default activeConfigs.concat(minifiedConfigs) Assumes And here's what it looks like in the context of a production module without Babel. |
What should we do if we want to build a bunch of assets in parallel but we want to host 1 webserver that contains multiple landing pages that are artifacts of the parallel builds? Should I just configure ONE of the parallel builds with the webserver? Will livereload be triggered across parallel builds? |
This PR adds support for rolling multiple bundles (with their own configs, or at least with their own entry/dest options) in parallel.
rollup.config.js
can now export an array of objects, or a single object.