webpack 5.59.0 → 5.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of webpack might be problematic. Click here for more details.

Files changed (236) hide show
  1. package/README.md +22 -24
  2. package/bin/webpack.js +0 -0
  3. package/hot/dev-server.js +17 -4
  4. package/hot/lazy-compilation-node.js +3 -1
  5. package/hot/poll.js +1 -1
  6. package/hot/signal.js +1 -1
  7. package/lib/APIPlugin.js +33 -0
  8. package/lib/BannerPlugin.js +13 -5
  9. package/lib/Cache.js +1 -1
  10. package/lib/CacheFacade.js +4 -11
  11. package/lib/Chunk.js +6 -3
  12. package/lib/ChunkGraph.js +94 -8
  13. package/lib/ChunkGroup.js +1 -1
  14. package/lib/CleanPlugin.js +81 -20
  15. package/lib/Compilation.js +188 -93
  16. package/lib/Compiler.js +87 -18
  17. package/lib/ConstPlugin.js +2 -2
  18. package/lib/ContextModule.js +142 -51
  19. package/lib/ContextModuleFactory.js +65 -25
  20. package/lib/DelegatedModule.js +1 -1
  21. package/lib/DelegatedModuleFactoryPlugin.js +1 -1
  22. package/lib/Dependency.js +17 -0
  23. package/lib/DependencyTemplate.js +9 -0
  24. package/lib/DependencyTemplates.js +1 -1
  25. package/lib/DllModule.js +1 -1
  26. package/lib/DllReferencePlugin.js +1 -1
  27. package/lib/EntryOptionPlugin.js +2 -0
  28. package/lib/ErrorHelpers.js +2 -2
  29. package/lib/EvalDevToolModulePlugin.js +16 -1
  30. package/lib/EvalSourceMapDevToolPlugin.js +25 -4
  31. package/lib/ExportsInfo.js +5 -5
  32. package/lib/ExternalModule.js +94 -54
  33. package/lib/ExternalModuleFactoryPlugin.js +5 -5
  34. package/lib/FileSystemInfo.js +124 -58
  35. package/lib/Generator.js +3 -0
  36. package/lib/HookWebpackError.js +1 -1
  37. package/lib/HotModuleReplacementPlugin.js +3 -1
  38. package/lib/LoaderOptionsPlugin.js +1 -1
  39. package/lib/Module.js +28 -4
  40. package/lib/ModuleFilenameHelpers.js +8 -4
  41. package/lib/ModuleHashingError.js +29 -0
  42. package/lib/MultiCompiler.js +1 -1
  43. package/lib/MultiWatching.js +1 -1
  44. package/lib/NodeStuffPlugin.js +13 -3
  45. package/lib/NormalModule.js +51 -33
  46. package/lib/NormalModuleFactory.js +42 -37
  47. package/lib/ProgressPlugin.js +4 -5
  48. package/lib/RawModule.js +1 -1
  49. package/lib/RuntimeGlobals.js +29 -1
  50. package/lib/RuntimeModule.js +1 -1
  51. package/lib/RuntimePlugin.js +84 -1
  52. package/lib/RuntimeTemplate.js +114 -2
  53. package/lib/Template.js +3 -2
  54. package/lib/TemplatedPathPlugin.js +48 -23
  55. package/lib/WatchIgnorePlugin.js +19 -7
  56. package/lib/Watching.js +33 -19
  57. package/lib/WebpackOptionsApply.js +79 -11
  58. package/lib/asset/AssetGenerator.js +228 -71
  59. package/lib/asset/AssetModulesPlugin.js +3 -0
  60. package/lib/asset/AssetParser.js +1 -0
  61. package/lib/asset/AssetSourceGenerator.js +31 -6
  62. package/lib/asset/AssetSourceParser.js +1 -0
  63. package/lib/asset/RawDataUrlModule.js +148 -0
  64. package/lib/async-modules/AwaitDependenciesInitFragment.js +4 -4
  65. package/lib/buildChunkGraph.js +38 -7
  66. package/lib/cache/PackFileCacheStrategy.js +15 -8
  67. package/lib/cache/ResolverCachePlugin.js +90 -29
  68. package/lib/cli.js +44 -3
  69. package/lib/config/browserslistTargetHandler.js +41 -6
  70. package/lib/config/defaults.js +123 -19
  71. package/lib/config/normalization.js +10 -2
  72. package/lib/config/target.js +10 -0
  73. package/lib/container/ContainerEntryModule.js +8 -5
  74. package/lib/container/FallbackModule.js +4 -4
  75. package/lib/container/ModuleFederationPlugin.js +2 -0
  76. package/lib/container/RemoteModule.js +4 -2
  77. package/lib/container/RemoteRuntimeModule.js +8 -7
  78. package/lib/css/CssExportsGenerator.js +139 -0
  79. package/lib/css/CssGenerator.js +109 -0
  80. package/lib/css/CssLoadingRuntimeModule.js +442 -0
  81. package/lib/css/CssModulesPlugin.js +462 -0
  82. package/lib/css/CssParser.js +618 -0
  83. package/lib/css/walkCssTokens.js +659 -0
  84. package/lib/debug/ProfilingPlugin.js +24 -21
  85. package/lib/dependencies/AMDRequireDependency.js +6 -6
  86. package/lib/dependencies/CommonJsExportsParserPlugin.js +1 -2
  87. package/lib/dependencies/CommonJsFullRequireDependency.js +5 -1
  88. package/lib/dependencies/CommonJsImportsParserPlugin.js +344 -61
  89. package/lib/dependencies/CommonJsRequireContextDependency.js +6 -2
  90. package/lib/dependencies/CommonJsRequireDependency.js +2 -1
  91. package/lib/dependencies/ContextDependency.js +16 -2
  92. package/lib/dependencies/ContextDependencyHelpers.js +21 -8
  93. package/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +4 -1
  94. package/lib/dependencies/ContextElementDependency.js +25 -3
  95. package/lib/dependencies/CreateScriptUrlDependency.js +12 -0
  96. package/lib/dependencies/CssExportDependency.js +85 -0
  97. package/lib/dependencies/CssImportDependency.js +75 -0
  98. package/lib/dependencies/CssLocalIdentifierDependency.js +119 -0
  99. package/lib/dependencies/CssSelfLocalIdentifierDependency.js +101 -0
  100. package/lib/dependencies/CssUrlDependency.js +132 -0
  101. package/lib/dependencies/ExportsInfoDependency.js +6 -0
  102. package/lib/dependencies/HarmonyAcceptImportDependency.js +5 -3
  103. package/lib/dependencies/HarmonyCompatibilityDependency.js +5 -5
  104. package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +127 -0
  105. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +12 -3
  106. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +25 -17
  107. package/lib/dependencies/HarmonyExportInitFragment.js +4 -1
  108. package/lib/dependencies/HarmonyImportDependency.js +23 -0
  109. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +142 -45
  110. package/lib/dependencies/HarmonyImportSpecifierDependency.js +46 -22
  111. package/lib/dependencies/HarmonyModulesPlugin.js +10 -0
  112. package/lib/dependencies/ImportContextDependency.js +0 -2
  113. package/lib/dependencies/ImportMetaContextDependency.js +35 -0
  114. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +252 -0
  115. package/lib/dependencies/ImportMetaContextPlugin.js +59 -0
  116. package/lib/dependencies/ImportMetaPlugin.js +22 -3
  117. package/lib/dependencies/ImportParserPlugin.js +35 -29
  118. package/lib/dependencies/JsonExportsDependency.js +17 -21
  119. package/lib/dependencies/LoaderDependency.js +13 -0
  120. package/lib/dependencies/LoaderImportDependency.js +13 -0
  121. package/lib/dependencies/LoaderPlugin.js +4 -2
  122. package/lib/dependencies/ModuleDependency.js +11 -1
  123. package/lib/dependencies/ProvidedDependency.js +31 -8
  124. package/lib/dependencies/RequireContextDependency.js +0 -16
  125. package/lib/dependencies/RequireEnsureDependency.js +2 -2
  126. package/lib/dependencies/RequireResolveContextDependency.js +2 -2
  127. package/lib/dependencies/RequireResolveDependency.js +2 -1
  128. package/lib/dependencies/URLDependency.js +3 -8
  129. package/lib/dependencies/URLPlugin.js +22 -1
  130. package/lib/dependencies/WorkerPlugin.js +2 -0
  131. package/lib/esm/ModuleChunkFormatPlugin.js +74 -49
  132. package/lib/esm/ModuleChunkLoadingPlugin.js +3 -1
  133. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +25 -9
  134. package/lib/hmr/HotModuleReplacement.runtime.js +29 -14
  135. package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +4 -3
  136. package/lib/hmr/LazyCompilationPlugin.js +54 -26
  137. package/lib/hmr/lazyCompilationBackend.js +51 -12
  138. package/lib/ids/DeterministicModuleIdsPlugin.js +55 -35
  139. package/lib/ids/HashedModuleIdsPlugin.js +11 -14
  140. package/lib/ids/IdHelpers.js +26 -12
  141. package/lib/ids/NamedModuleIdsPlugin.js +6 -9
  142. package/lib/ids/NaturalModuleIdsPlugin.js +10 -13
  143. package/lib/ids/OccurrenceModuleIdsPlugin.js +13 -10
  144. package/lib/ids/SyncModuleIdsPlugin.js +140 -0
  145. package/lib/index.js +20 -0
  146. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +2 -2
  147. package/lib/javascript/BasicEvaluatedExpression.js +5 -2
  148. package/lib/javascript/ChunkHelpers.js +33 -0
  149. package/lib/javascript/JavascriptGenerator.js +1 -0
  150. package/lib/javascript/JavascriptModulesPlugin.js +27 -2
  151. package/lib/javascript/JavascriptParser.js +143 -73
  152. package/lib/javascript/StartupHelpers.js +7 -30
  153. package/lib/json/JsonData.js +8 -0
  154. package/lib/json/JsonParser.js +4 -6
  155. package/lib/library/AssignLibraryPlugin.js +39 -15
  156. package/lib/library/EnableLibraryPlugin.js +11 -0
  157. package/lib/library/UmdLibraryPlugin.js +5 -3
  158. package/lib/node/NodeTargetPlugin.js +3 -0
  159. package/lib/node/NodeWatchFileSystem.js +85 -31
  160. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +23 -8
  161. package/lib/node/RequireChunkLoadingRuntimeModule.js +24 -9
  162. package/lib/optimize/ConcatenatedModule.js +62 -26
  163. package/lib/optimize/ModuleConcatenationPlugin.js +26 -4
  164. package/lib/optimize/RealContentHashPlugin.js +45 -15
  165. package/lib/optimize/SplitChunksPlugin.js +8 -1
  166. package/lib/runtime/AsyncModuleRuntimeModule.js +50 -66
  167. package/lib/runtime/BaseUriRuntimeModule.js +31 -0
  168. package/lib/runtime/CreateScriptRuntimeModule.js +36 -0
  169. package/lib/runtime/CreateScriptUrlRuntimeModule.js +9 -34
  170. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +76 -0
  171. package/lib/runtime/LoadScriptRuntimeModule.js +11 -9
  172. package/lib/runtime/NonceRuntimeModule.js +24 -0
  173. package/lib/schemes/HttpUriPlugin.js +77 -14
  174. package/lib/serialization/FileMiddleware.js +44 -9
  175. package/lib/sharing/ConsumeSharedModule.js +8 -2
  176. package/lib/sharing/ConsumeSharedRuntimeModule.js +26 -5
  177. package/lib/sharing/ProvideSharedModule.js +4 -2
  178. package/lib/sharing/ProvideSharedPlugin.js +1 -2
  179. package/lib/sharing/ShareRuntimeModule.js +1 -1
  180. package/lib/sharing/utils.js +1 -1
  181. package/lib/stats/DefaultStatsFactoryPlugin.js +113 -68
  182. package/lib/stats/DefaultStatsPrinterPlugin.js +90 -25
  183. package/lib/util/ArrayHelpers.js +30 -0
  184. package/lib/util/AsyncQueue.js +1 -1
  185. package/lib/util/compileBooleanMatcher.js +1 -1
  186. package/lib/util/create-schema-validation.js +9 -2
  187. package/lib/util/createHash.js +12 -0
  188. package/lib/util/deprecation.js +10 -2
  189. package/lib/util/deterministicGrouping.js +1 -1
  190. package/lib/util/extractUrlAndGlobal.js +3 -0
  191. package/lib/util/fs.js +11 -0
  192. package/lib/util/hash/BatchedHash.js +7 -4
  193. package/lib/util/hash/md4.js +20 -0
  194. package/lib/util/hash/wasm-hash.js +163 -0
  195. package/lib/util/hash/xxhash64.js +5 -139
  196. package/lib/util/identifier.js +65 -44
  197. package/lib/util/internalSerializables.js +15 -0
  198. package/lib/util/nonNumericOnlyHash.js +22 -0
  199. package/lib/util/semver.js +17 -10
  200. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +9 -3
  201. package/lib/wasm-sync/WebAssemblyParser.js +1 -1
  202. package/lib/web/JsonpChunkLoadingRuntimeModule.js +31 -18
  203. package/lib/webpack.js +10 -3
  204. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +3 -11
  205. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +33 -22
  206. package/module.d.ts +215 -0
  207. package/package.json +28 -32
  208. package/schemas/WebpackOptions.check.js +1 -1
  209. package/schemas/WebpackOptions.json +321 -30
  210. package/schemas/plugins/BannerPlugin.check.js +1 -1
  211. package/schemas/plugins/BannerPlugin.json +4 -0
  212. package/schemas/plugins/DllReferencePlugin.check.js +1 -1
  213. package/schemas/plugins/HashedModuleIdsPlugin.check.js +1 -1
  214. package/schemas/plugins/ProgressPlugin.check.js +1 -1
  215. package/schemas/plugins/asset/AssetGeneratorOptions.check.js +1 -1
  216. package/schemas/plugins/asset/AssetParserOptions.check.js +1 -1
  217. package/schemas/plugins/asset/AssetResourceGeneratorOptions.check.js +1 -1
  218. package/schemas/plugins/container/ContainerPlugin.check.js +1 -1
  219. package/schemas/plugins/container/ContainerPlugin.json +2 -1
  220. package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
  221. package/schemas/plugins/container/ContainerReferencePlugin.json +1 -0
  222. package/schemas/plugins/container/ExternalsType.check.js +1 -1
  223. package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
  224. package/schemas/plugins/container/ModuleFederationPlugin.json +3 -1
  225. package/schemas/plugins/css/CssGeneratorOptions.check.d.ts +7 -0
  226. package/schemas/plugins/css/CssGeneratorOptions.check.js +6 -0
  227. package/schemas/plugins/css/CssGeneratorOptions.json +3 -0
  228. package/schemas/plugins/css/CssParserOptions.check.d.ts +7 -0
  229. package/schemas/plugins/css/CssParserOptions.check.js +6 -0
  230. package/schemas/plugins/css/CssParserOptions.json +3 -0
  231. package/schemas/plugins/optimize/AggressiveSplittingPlugin.check.js +1 -1
  232. package/schemas/plugins/optimize/LimitChunkCountPlugin.check.js +1 -1
  233. package/schemas/plugins/optimize/MinChunkSizePlugin.check.js +1 -1
  234. package/schemas/plugins/schemes/HttpUriPlugin.check.js +1 -1
  235. package/schemas/plugins/schemes/HttpUriPlugin.json +4 -0
  236. package/types.d.ts +869 -296
@@ -123,9 +123,7 @@ class Profiler {
123
123
  * @returns {Trace} The trace object
124
124
  */
125
125
  const createTrace = (fs, outputPath) => {
126
- const trace = new Tracer({
127
- noStream: true
128
- });
126
+ const trace = new Tracer();
129
127
  const profiler = new Profiler(inspector);
130
128
  if (/\/|\\/.test(outputPath)) {
131
129
  const dirPath = dirname(fs, outputPath);
@@ -173,6 +171,7 @@ const createTrace = (fs, outputPath) => {
173
171
  counter,
174
172
  profiler,
175
173
  end: callback => {
174
+ trace.push("]");
176
175
  // Wait until the write stream finishes.
177
176
  fsStream.on("close", () => {
178
177
  callback();
@@ -203,15 +202,17 @@ class ProfilingPlugin {
203
202
 
204
203
  // Compiler Hooks
205
204
  Object.keys(compiler.hooks).forEach(hookName => {
206
- compiler.hooks[hookName].intercept(
207
- makeInterceptorFor("Compiler", tracer)(hookName)
208
- );
205
+ const hook = compiler.hooks[hookName];
206
+ if (hook) {
207
+ hook.intercept(makeInterceptorFor("Compiler", tracer)(hookName));
208
+ }
209
209
  });
210
210
 
211
211
  Object.keys(compiler.resolverFactory.hooks).forEach(hookName => {
212
- compiler.resolverFactory.hooks[hookName].intercept(
213
- makeInterceptorFor("Resolver", tracer)(hookName)
214
- );
212
+ const hook = compiler.resolverFactory.hooks[hookName];
213
+ if (hook) {
214
+ hook.intercept(makeInterceptorFor("Resolver", tracer)(hookName));
215
+ }
215
216
  });
216
217
 
217
218
  compiler.hooks.compilation.tap(
@@ -240,10 +241,10 @@ class ProfilingPlugin {
240
241
  stage: Infinity
241
242
  },
242
243
  (stats, callback) => {
244
+ if (compiler.watchMode) return callback();
243
245
  tracer.profiler.stopProfiling().then(parsedResults => {
244
246
  if (parsedResults === undefined) {
245
247
  tracer.profiler.destroy();
246
- tracer.trace.flush();
247
248
  tracer.end(callback);
248
249
  return;
249
250
  }
@@ -291,7 +292,6 @@ class ProfilingPlugin {
291
292
  });
292
293
 
293
294
  tracer.profiler.destroy();
294
- tracer.trace.flush();
295
295
  tracer.end(callback);
296
296
  });
297
297
  }
@@ -303,7 +303,7 @@ const interceptAllHooksFor = (instance, tracer, logLabel) => {
303
303
  if (Reflect.has(instance, "hooks")) {
304
304
  Object.keys(instance.hooks).forEach(hookName => {
305
305
  const hook = instance.hooks[hookName];
306
- if (!hook._fakeHook) {
306
+ if (hook && !hook._fakeHook) {
307
307
  hook.intercept(makeInterceptorFor(logLabel, tracer)(hookName));
308
308
  }
309
309
  });
@@ -343,16 +343,19 @@ const interceptAllJavascriptModulesPluginHooks = (compilation, tracer) => {
343
343
  };
344
344
 
345
345
  const makeInterceptorFor = (instance, tracer) => hookName => ({
346
- register: ({ name, type, context, fn }) => {
347
- const newFn = makeNewProfiledTapFn(hookName, tracer, {
348
- name,
349
- type,
350
- fn
351
- });
346
+ register: tapInfo => {
347
+ const { name, type, fn } = tapInfo;
348
+ const newFn =
349
+ // Don't tap our own hooks to ensure stream can close cleanly
350
+ name === pluginName
351
+ ? fn
352
+ : makeNewProfiledTapFn(hookName, tracer, {
353
+ name,
354
+ type,
355
+ fn
356
+ });
352
357
  return {
353
- name,
354
- type,
355
- context,
358
+ ...tapInfo,
356
359
  fn: newFn
357
360
  };
358
361
  }
@@ -90,7 +90,7 @@ AMDRequireDependency.Template = class AMDRequireDependencyTemplate extends (
90
90
  // has array range but no function range
91
91
  if (dep.arrayRange && !dep.functionRange) {
92
92
  const startBlock = `${promise}.then(function() {`;
93
- const endBlock = `;}).catch(${RuntimeGlobals.uncaughtErrorHandler})`;
93
+ const endBlock = `;})['catch'](${RuntimeGlobals.uncaughtErrorHandler})`;
94
94
  runtimeRequirements.add(RuntimeGlobals.uncaughtErrorHandler);
95
95
 
96
96
  source.replace(dep.outerRange[0], dep.arrayRange[0] - 1, startBlock);
@@ -103,7 +103,7 @@ AMDRequireDependency.Template = class AMDRequireDependencyTemplate extends (
103
103
  // has function range but no array range
104
104
  if (dep.functionRange && !dep.arrayRange) {
105
105
  const startBlock = `${promise}.then((`;
106
- const endBlock = `).bind(exports, __webpack_require__, exports, module)).catch(${RuntimeGlobals.uncaughtErrorHandler})`;
106
+ const endBlock = `).bind(exports, __webpack_require__, exports, module))['catch'](${RuntimeGlobals.uncaughtErrorHandler})`;
107
107
  runtimeRequirements.add(RuntimeGlobals.uncaughtErrorHandler);
108
108
 
109
109
  source.replace(dep.outerRange[0], dep.functionRange[0] - 1, startBlock);
@@ -118,7 +118,7 @@ AMDRequireDependency.Template = class AMDRequireDependencyTemplate extends (
118
118
  const startBlock = `${promise}.then(function() { `;
119
119
  const errorRangeBlock = `}${
120
120
  dep.functionBindThis ? ".bind(this)" : ""
121
- }).catch(`;
121
+ })['catch'](`;
122
122
  const endBlock = `${dep.errorCallbackBindThis ? ".bind(this)" : ""})`;
123
123
 
124
124
  source.replace(dep.outerRange[0], dep.arrayRange[0] - 1, startBlock);
@@ -150,9 +150,9 @@ AMDRequireDependency.Template = class AMDRequireDependencyTemplate extends (
150
150
  // has array range, function range, but no errorCallbackRange
151
151
  if (dep.arrayRange && dep.functionRange) {
152
152
  const startBlock = `${promise}.then(function() { `;
153
- const endBlock = `}${dep.functionBindThis ? ".bind(this)" : ""}).catch(${
154
- RuntimeGlobals.uncaughtErrorHandler
155
- })`;
153
+ const endBlock = `}${
154
+ dep.functionBindThis ? ".bind(this)" : ""
155
+ })['catch'](${RuntimeGlobals.uncaughtErrorHandler})`;
156
156
  runtimeRequirements.add(RuntimeGlobals.uncaughtErrorHandler);
157
157
 
158
158
  source.replace(dep.outerRange[0], dep.arrayRange[0] - 1, startBlock);
@@ -201,7 +201,7 @@ class CommonJsExportsParserPlugin {
201
201
  if (expr.arguments[1].type === "SpreadElement") return;
202
202
  if (expr.arguments[2].type === "SpreadElement") return;
203
203
  const exportsArg = parser.evaluateExpression(expr.arguments[0]);
204
- if (!exportsArg || !exportsArg.isIdentifier()) return;
204
+ if (!exportsArg.isIdentifier()) return;
205
205
  if (
206
206
  exportsArg.identifier !== "exports" &&
207
207
  exportsArg.identifier !== "module.exports" &&
@@ -210,7 +210,6 @@ class CommonJsExportsParserPlugin {
210
210
  return;
211
211
  }
212
212
  const propertyArg = parser.evaluateExpression(expr.arguments[1]);
213
- if (!propertyArg) return;
214
213
  const property = propertyArg.asString();
215
214
  if (typeof property !== "string") return;
216
215
  enableStructuredExports();
@@ -117,7 +117,11 @@ CommonJsFullRequireDependency.Template = class CommonJsFullRequireDependencyTemp
117
117
  const comment = equals(usedImported, ids)
118
118
  ? ""
119
119
  : Template.toNormalComment(propertyAccess(ids)) + " ";
120
- requireExpr += `${comment}${propertyAccess(usedImported)}`;
120
+ const access = `${comment}${propertyAccess(usedImported)}`;
121
+ requireExpr =
122
+ dep.asiSafe === true
123
+ ? `(${requireExpr}${access})`
124
+ : `${requireExpr}${access}`;
121
125
  }
122
126
  }
123
127
  source.replace(dep.range[0], dep.range[1] - 1, requireExpr);