Skip to content

Commit

Permalink
docs: add 'modern-module' value for output.library.type
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Aug 24, 2024
1 parent 5f1a471 commit 5a33559
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/content/configuration/output.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,27 @@ Output ES Module.

However this feature is still experimental and not fully supported yet, so make sure to enable [experiments.outputModule](/configuration/experiments/) beforehand. In addition, you can track the development progress in [this thread](https://github.com/webpack/webpack/issues/2933#issuecomment-774253975).

##### type: 'modern-module'

```js
module.exports = {
// …
experiments: {
outputModule: true,
},
output: {
library: {
// do not specify a `name` here
type: 'modern-module',
},
},
};
```

This configuration generates tree-shakable output for ES Modules.

However this feature is still experimental and not fully supported yet, so make sure to enable [experiments.outputModule](/configuration/experiments/) beforehand.

##### type: 'commonjs2'

```js
Expand Down

0 comments on commit 5a33559

Please sign in to comment.