Skip to content

input

  • Type: optional input: string | string[] | Record<string, string>

Defines entries and location(s) of entry modules for the bundle. Relative paths are resolved based on the cwd option.

Examples

Single entry

js
export default defineConfig({
  input: 'src/index.js',
});

Multiple entries

js
export default defineConfig({
  input: ['src/index.js', 'src/vendor.js'],
});

Named multiple entries

js
export default defineConfig({
  input: {
    index: 'src/index.js',
    utils: 'src/utils/index.js',
    'components/Foo': 'src/components/Foo.js',
  },
});

In-depth

input allows you to specify one or more entries with names for the bundling process.

When multiple entries are specified (either as an array or an object), Rolldown will create separate entry chunks for each entry.

The generated chunk names will follow the output.chunkFileNames option. When using the object form, the [name] portion of the file name will be the name of the object property while for the array form, it will be the file name of the entry point. Note that it is possible when using the object form to put entry points into different sub-folders by adding a / to the name.

Released under the MIT License.