Skip to content

moduleTypes ​

Maps file patterns to module types, controlling how files are processed.

This is conceptually similar to esbuild's loader option, allowing you to specify how each file extensions should be handled.

See the In-Depth Guide for more details.

With experimental.importAttributes, a type import attribute of json, text or bytes wins over this option.

Example ​

js
import { defineConfig } from 'rolldown'

export default defineConfig({
  moduleTypes: {
    '.frag': 'text',
  }
})

Was this page helpful?