I am using Rollup to bundle my code for production.
I have multiple js files, so I am using the Rollup plugin-multi-entry plugin to use a glob pattern to target all of my js files.
I am outputting the files in umd format.
Currently they are being output as one js file, bundled all together, this is the expected behavior, but I would like to out put them all individually as well, transpiled to es5 and in umd format but not concatonated into one js bundle file, how can I do this?
Current setup:
import babel from "rollup-plugin-babel";
import { terser } from "rollup-plugin-terser";
import multi from "@rollup/plugin-multi-entry";
import gzipPlugin from "rollup-plugin-gzip";
export default [{
input: "src/**/*.logic.js",
output: {
dir: "build/assets/js",
format: "umd",
name: "Logic"
},
plugins: [
gzipPlugin(),
multi({
exports: true
}),
babel({
exclude: "node_modules/**"
})
]
}]
https://rollupjs.org/guide/en/#configuration-files
Here's an example:
export default [
{
input: 'main-a.js',
output: {
file: 'dist/bundle-a.js',
format: 'cjs'
}
},
{
input: 'main-b.js',
output: [
{
file: 'dist/bundle-b1.js',
format: 'cjs'
},
{
file: 'dist/bundle-b2.js',
format: 'es'
}
]
}
];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With