Skip to content

Commit

Permalink
docs(guides): add emit section for asset modules (#6411)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxsan authored Sep 21, 2022
1 parent 3b68bd6 commit 7c2cc4e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/content/guides/asset-modules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -472,3 +472,24 @@ module: {
]
},
```
## Disable emitting assets
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`:
```js
module.exports = {
//
module: {
rules: [
{
test: /\.png$/i,
type: 'asset/resource',
generator: {
emit: false,
},
},
],
},
};
```

1 comment on commit 7c2cc4e

@vercel
Copy link

@vercel vercel bot commented on 7c2cc4e Sep 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.