--- description: 'Whether to output JavaScript files in ES modules format.' --- # output.module - **Type:** `boolean` - **Default:** `true` when `output.target` is `node`, otherwise `false` Whether to output JavaScript files in ES modules format. :::tip - If you need to build JavaScript libraries in ESM format, we recommend using [Rslib](https://rslib.rs), which is an out-of-the-box library development tool built on top of Rsbuild. ::: ## Web applications When building a web application, Rsbuild generates the output in the IIFE format by default. If you want to output ES Modules instead, set `output.module` to `true`: ```ts title="rsbuild.config.ts" export default { output: { module: true, }, }; ``` :::tip When `output.module` is enabled, Rsbuild automatically adds `type="module"` to the generated `