Can I have multiple entry points using Rollup with Gulp?

Now, you can just return an array of objects from rollup.config.js.

So if you

  • need to compile a single file, return the object export default {...}
  • need to compile multiple files, return list of objects export default [{...},{...},{...}, ...]

Look here for inspiration

  • cheatsheet

You can now use https://github.com/alfredosalzillo/rollup-plugin-multi-input, it also preserve directory tree in output dir.

import multiInput from 'rollup-plugin-multi-input';

export default {
    input: ['src/**/*.js'],
    experimentalCodeSplitting: true,
    output: {
      format: 'esm',
      dir: 'dist'
    },
    plugins: [ multiInput() ],
};

Tags:

Gulp

Rollupjs