diff --git a/package.json b/package.json index d8e869691f5a..946ea8d5fa7b 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "@pmmmwh/react-refresh-webpack-plugin": "next", "@svgr/webpack": "^6.2.1", "autoprefixer": "^10.4.4", - "babel-loader": "^8.2.4", + "babel-loader": "^8.2.5", "copy-webpack-plugin": "^10.2.4", "css-loader": "^6.7.1", "css-minimizer-webpack-plugin": "^3.4.1", @@ -107,7 +107,7 @@ "husky": "^7.0.4", "hyperlink": "^5.0.4", "jest": "^27.5.1", - "lint-staged": "^12.3.8", + "lint-staged": "^12.4.0", "lodash": "^4.17.21", "markdownlint": "^0.25.1", "markdownlint-cli": "^0.31.1", diff --git a/src/content/concepts/module-resolution.mdx b/src/content/concepts/module-resolution.mdx index 42bf1e401e20..c19af8a25641 100644 --- a/src/content/concepts/module-resolution.mdx +++ b/src/content/concepts/module-resolution.mdx @@ -45,7 +45,11 @@ import '../src/file1'; import './file2'; ``` +<<<<<<< HEAD 在这种情况下,使用 `import` 或 `require` 的资源文件所处的目录,被认为是上下文目录。在 `import/require` 中给定的相对路径,会拼接此上下文路径,来生成模块的绝对路径。 +======= +In this case, the directory of the source file where the `import` or `require` occurs is taken to be the context directory. The relative path specified in the `import/require` is joined to this context path to produce the absolute path to the module. +>>>>>>> 80e0084cc947bb14c7cb5e820b507709b9e63e98 ### 模块路径 $#module-paths$ diff --git a/src/content/configuration/module.mdx b/src/content/configuration/module.mdx index 0ad302dc2aab..7c1848fe9474 100644 --- a/src/content/configuration/module.mdx +++ b/src/content/configuration/module.mdx @@ -206,6 +206,25 @@ const x = require(/* webpackIgnore: true */ 'x'); }; ``` +#### module.parser.javascript.importMeta + +Enable or disable evaluating `import.meta`. + +- Type: `boolean = true` +- Available: 5.68.0+ +- Example: + ```js + module.exports = { + module: { + parser: { + javascript: { + importMeta: false, + }, + }, + }, + }; + ``` + #### module.parser.javascript.importMetaContext 启用/禁用 [`import.meta.webpackContext`](/api/module-variables/#importmetawebpackcontext) 分析。 diff --git a/yarn.lock b/yarn.lock index 26652c46bcb0..585360d234d1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3599,10 +3599,10 @@ babel-jest@^27.5.1: graceful-fs "^4.2.9" slash "^3.0.0" -babel-loader@^8.2.4: - version "8.2.4" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.4.tgz#95f5023c791b2e9e2ca6f67b0984f39c82ff384b" - integrity sha512-8dytA3gcvPPPv4Grjhnt8b5IIiTcq/zeXOPk4iTYI0SVXcsmuGg7JtBRDp8S9X+gJfhQ8ektjXZlDu1Bb33U8A== +babel-loader@^8.2.5: + version "8.2.5" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.5.tgz#d45f585e654d5a5d90f5350a779d7647c5ed512e" + integrity sha512-OSiFfH89LrEMiWd4pLNqGz4CwJDtbs2ZVc+iGu2HrkRfPxId9F2anQj38IxWpmRfsUY0aBZYi1EFcd3mhtRMLQ== dependencies: find-cache-dir "^3.3.1" loader-utils "^2.0.0" @@ -8152,12 +8152,12 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -lilconfig@2.0.4, lilconfig@^2.0.3: +lilconfig@2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.4.tgz#f4507d043d7058b380b6a8f5cb7bcd4b34cee082" integrity sha512-bfTIN7lEsiooCocSISTWXkiWJkRqtL9wYtYy+8EK3Y41qh3mpwPU0ycTOgjdY9ErwXCc8QyrQp82bdL0Xkm9yA== -lilconfig@^2.0.5: +lilconfig@^2.0.3, lilconfig@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.5.tgz#19e57fd06ccc3848fd1891655b5a447092225b25" integrity sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg== @@ -8174,10 +8174,10 @@ linkify-it@^3.0.1: dependencies: uc.micro "^1.0.1" -lint-staged@^12.3.8: - version "12.3.8" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-12.3.8.tgz#ee3fe2e16c9d76f99d8348072900b017d6d76901" - integrity sha512-0+UpNaqIwKRSGAFOCcpuYNIv/j5QGVC+xUVvmSdxHO+IfIGoHbFLo3XcPmV/LLnsVj5EAncNHVtlITSoY5qWGQ== +lint-staged@^12.4.0: + version "12.4.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-12.4.0.tgz#1fb8c73ac7a1c670b87bd2c1bf1e302c866e77af" + integrity sha512-3X7MR0h9b7qf4iXf/1n7RlVAx+EzpAZXoCEMhVSpaBlgKDfH2ewf+QUm7BddFyq29v4dgPP+8+uYpWuSWx035A== dependencies: cli-truncate "^3.1.0" colorette "^2.0.16"