@@ -147,16 +147,10 @@ module.exports = {
147147
148148为 CommonJS 启用 [ 魔法注释] ( /api/module-methods/#magic-comments ) 。
149149
150- <<<<<<< HEAD
151150- 类型:` boolean `
152151- 可用版本:5.17.0+
153152- 示例:
154- =======
155- - Type: `boolean`
156- - Available: 5.17.0+
157- - Example:
158153
159- >>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
160154 ``` js
161155 module .exports = {
162156 module: {
@@ -179,16 +173,10 @@ const x = require(/* webpackIgnore: true */ 'x');
179173
180174指定动态导入的全局模式。
181175
182- <<<<<<< HEAD
183176- 类型:` 'eager' | 'weak' | 'lazy' | 'lazy-once' `
184177- 可用版本:5.73.0+
185178- 示例:
186- =======
187- - Type: `'eager' | ' weak' | ' lazy' | ' lazy-once' `
188- - Available: 5.73.0+
189- - Example:
190179
191- >>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
192180 ``` js
193181 module .exports = {
194182 module: {
@@ -205,16 +193,10 @@ const x = require(/* webpackIgnore: true */ 'x');
205193
206194指定动态导入的全局 prefetch。
207195
208- <<<<<<< HEAD
209196- 类型:` number | boolean `
210197- 可用版本:5.73.0+
211198- 示例:
212- =======
213- - Type: ` number | boolean`
214- - Available: 5.73.0+
215- - Example:
216199
217- >>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
218200 ``` js
219201 module .exports = {
220202 module: {
@@ -231,16 +213,10 @@ const x = require(/* webpackIgnore: true */ 'x');
231213
232214指定动态导入的全局 preload。
233215
234- <<<<<<< HEAD
235216- 类型:` number | boolean `
236217- 可用版本:5.73.0+
237218- 示例:
238- =======
239- - Type: ` number | boolean`
240- - Available: 5.73.0+
241- - Example:
242219
243- >>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
244220 ``` js
245221 module .exports = {
246222 module: {
@@ -257,16 +233,10 @@ const x = require(/* webpackIgnore: true */ 'x');
257233
258234指出在 ` \"import ... from ...\" ` 与 ` \"export ... from ...\" ` 中无效导出名称的行为。
259235
260- <<<<<<< HEAD
261236- 类型:` 'error' | 'warn' | 'auto' | false `
262237- 可用版本:5.62.0+
263238- 示例:
264- =======
265- - Type: `'error' | ' warn' | ' auto' | false`
266- - Available: 5.62.0+
267- - Example:
268239
269- >>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
270240 ``` js
271241 module .exports = {
272242 module: {
@@ -283,16 +253,10 @@ const x = require(/* webpackIgnore: true */ 'x');
283253
284254指出在 ` \"import ... from ...\" ` 中无效导出名称的行为。
285255
286- <<<<<<< HEAD
287256- 类型:` 'error' | 'warn' | 'auto' | false `
288257- 可用版本:5.62.0+
289258- 示例:
290- =======
291- - Type: `'error' | ' warn' | ' auto' | false`
292- - Available: 5.62.0+
293- - Example:
294259
295- >>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
296260 ``` js
297261 module .exports = {
298262 module: {
@@ -309,16 +273,10 @@ const x = require(/* webpackIgnore: true */ 'x');
309273
310274Enable or disable evaluating ` import.meta ` .
311275
312- <<<<<<< HEAD
313276- 类型:` boolean = true `
314277- 可用版本:5.68.0+
315278- 示例:
316- =======
317- - Type: `boolean = true`
318- - Available: 5.68.0+
319- - Example:
320279
321- >>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
322280 ``` js
323281 module .exports = {
324282 module: {
@@ -335,16 +293,10 @@ Enable or disable evaluating `import.meta`.
335293
336294启用/禁用 [ ` import.meta.webpackContext ` ] ( /api/module-variables/#importmetawebpackcontext ) 分析。
337295
338- <<<<<<< HEAD
339296- 类型:` boolean `
340297- 可用版本:5.70.0+
341298- 示例:
342- =======
343- - Type: `boolean`
344- - Available: 5.70.0+
345- - Example:
346299
347- >>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
348300 ``` js
349301 module .exports = {
350302 module: {
@@ -361,16 +313,10 @@ Enable or disable evaluating `import.meta`.
361313
362314指出在 ` \"export ... from ...\" ` 中无效导出名称的行为。当在 TypeScript 重新导出类型,从 ` \"export ... from ...\" ` 迁移到 ` \"export type ... from ...\" ` 时禁用该配置项是有用的。
363315
364- <<<<<<< HEAD
365316- 类型:` 'error' | 'warn' | 'auto' | false `
366317- 可用版本:5.62.0+
367318- 示例:
368- =======
369- - Type: `'error' | ' warn' | ' auto' | false`
370- - Available: 5.62.0+
371- - Example:
372319
373- >>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
374320 ``` js
375321 module .exports = {
376322 module: {
@@ -387,14 +333,9 @@ Enable or disable evaluating `import.meta`.
387333
388334启用 ` new URL() ` 语法解析。
389335
390- <<<<<<< HEAD
391336- 类型:` boolean = true ` | ` 'relative' `
392337- 示例:
393- =======
394- - Type: `boolean = true` | `'relative'`
395- - Example:
396338
397- >>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
398339 ``` js
399340 module .exports = {
400341 module: {
@@ -717,7 +658,6 @@ module.exports = {
717658 {
718659 // ...
719660 parser: {
720- <<<<<< < HEAD
721661 amd: false , // 禁用 AMD
722662 commonjs: false , // 禁用 CommonJS
723663 system: false , // 禁用 SystemJS
@@ -728,33 +668,14 @@ module.exports = {
728668 browserify: false , // 禁用特殊处理的 browserify bundle
729669 requireJs: false , // 禁用 requirejs.*
730670 node: false , // 禁用 __dirname, __filename, module, require.extensions, require.main, 等。
731- node: {... }, // 在模块级别(module level)上重新配置 [node](/configuration/node) 层(layer)
671+ commonjsMagicComments: false , // 禁用对 CommonJS 的 magic comments 支持
672+ node: {}, // 在模块级别(module level)上重新配置 node 层(layer)
732673 worker: [" default from web-worker" , " ..." ] // 自定义 WebWorker 对 JavaScript 的处理,其中 "..." 为默认值。
733674 }
734675 }
735676 ]
736677 }
737678}
738- ====== =
739- amd: false , // disable AMD
740- commonjs: false , // disable CommonJS
741- system: false , // disable SystemJS
742- harmony: false , // disable ES2015 Harmony import/export
743- requireInclude: false , // disable require.include
744- requireEnsure: false , // disable require.ensure
745- requireContext: false , // disable require.context
746- browserify: false , // disable special handling of Browserify bundles
747- requireJs: false , // disable requirejs.*
748- node: false , // disable __dirname, __filename, module, require.extensions, require.main, etc.
749- commonjsMagicComments: false , // disable magic comments support for CommonJS
750- node: {}, // reconfigure node layer on module level
751- worker: [' default from web-worker' , ' ...' ], // Customize the WebWorker handling for javascript files, "..." refers to the defaults.
752- },
753- },
754- ],
755- },
756- };
757- >>>>>> > 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
758679```
759680
760681如果 ` Rule.type ` 的值为 ` asset ` ,那么 ` Rules.parser ` 选项可能是一个对象或一个函数,其作用可能是将文件内容编码为 Base64,还可能是将其当做单独文件 emit 到输出目录。
0 commit comments