diff --git a/src/content/guides/asset-modules.mdx b/src/content/guides/asset-modules.mdx index ede35935412d..0b47ba63a3d2 100644 --- a/src/content/guides/asset-modules.mdx +++ b/src/content/guides/asset-modules.mdx @@ -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, + }, + }, + ], + }, +}; +```