Skip to content

Commit 7c2cc4e

Browse files
authored
docs(guides): add emit section for asset modules (#6411)
1 parent 3b68bd6 commit 7c2cc4e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/content/guides/asset-modules.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,3 +472,24 @@ module: {
472472
]
473473
},
474474
```
475+
476+
## Disable emitting assets
477+
478+
For use cases like Server side rendering, you might want to disable emitting assets, which is feasible with [`emit`](/configuration/module/#rulegeneratoremit) option under `Rule.generator`:
479+
480+
```js
481+
module.exports = {
482+
//
483+
module: {
484+
rules: [
485+
{
486+
test: /\.png$/i,
487+
type: 'asset/resource',
488+
generator: {
489+
emit: false,
490+
},
491+
},
492+
],
493+
},
494+
};
495+
```

0 commit comments

Comments
 (0)