From b81a971e22527fa00b84f77b3a5a159526e04be6 Mon Sep 17 00:00:00 2001
From: xiaoxiaojx <784487301@qq.com>
Date: Sat, 30 Aug 2025 23:11:33 +0800
Subject: [PATCH 1/2] docs: add Snapshots.contextModule and
Rule.extractSourceMap
---
src/content/configuration/module.mdx | 23 +++++++++++++++++++++
src/content/configuration/other-options.mdx | 9 ++++++++
2 files changed, 32 insertions(+)
diff --git a/src/content/configuration/module.mdx b/src/content/configuration/module.mdx
index 17b89833d1e8..12ae973bd416 100644
--- a/src/content/configuration/module.mdx
+++ b/src/content/configuration/module.mdx
@@ -1707,6 +1707,29 @@ import one from './pkg-1.json' with { type: 'json' };
In this example, `Rule.with` is used to apply `loader-assert.js` to any module imported with the condition `with { type: "json" }`.
+## Rule.extractSourceMap
+
+
+
+`boolean = false`
+
+extract sourceMappingURL comments from modules.
+
+**webpack.config.js**
+
+```js
+module.exports = {
+ // ...
+ module: {
+ rules: [
+ {
+ extractSourceMap: true,
+ },
+ ],
+ },
+};
+```
+
## Condition
Conditions can be one of these:
diff --git a/src/content/configuration/other-options.mdx b/src/content/configuration/other-options.mdx
index 05b496f50b2e..28bc357a336b 100644
--- a/src/content/configuration/other-options.mdx
+++ b/src/content/configuration/other-options.mdx
@@ -354,3 +354,12 @@ Snapshots for resolving of build dependencies when using the persistent cache.
- `hash`: Compare content hashes to determine invalidation (more expensive than `timestamp`, but changes less often).
- `timestamp`: Compare timestamps to determine invalidation.
+
+### contextModule
+
+`object = {hash boolean = true, timestamp boolean = true}`
+
+Snapshots for building [context modules](/configuration/module/#module-contexts).
+
+- `hash`: Compare content hashes to determine invalidation (more expensive than `timestamp`, but changes less often).
+- `timestamp`: Compare timestamps to determine invalidation.
From 80bdcfcee159e4479ae5c218de425fe63755f69a Mon Sep 17 00:00:00 2001
From: xiaoxiaojx <784487301@qq.com>
Date: Sat, 30 Aug 2025 23:15:06 +0800
Subject: [PATCH 2/2] docs: add Snapshots.contextModule and
Rule.extractSourceMap
---
src/content/configuration/other-options.mdx | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/content/configuration/other-options.mdx b/src/content/configuration/other-options.mdx
index 28bc357a336b..ad03fa099ed1 100644
--- a/src/content/configuration/other-options.mdx
+++ b/src/content/configuration/other-options.mdx
@@ -357,6 +357,8 @@ Snapshots for resolving of build dependencies when using the persistent cache.
### contextModule
+
+
`object = {hash boolean = true, timestamp boolean = true}`
Snapshots for building [context modules](/configuration/module/#module-contexts).