@umijs/bundler-utoopack 4.6.64 → 4.6.66

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.
Files changed (2) hide show
  1. package/dist/config.js +8 -2
  2. package/package.json +3 -3
package/dist/config.js CHANGED
@@ -249,6 +249,12 @@ function getOverlayEntryPath(cwd, entryName) {
249
249
  )
250
250
  );
251
251
  }
252
+ function createDynamicImportChain(imports) {
253
+ return `void ${imports.map(
254
+ (item, index) => index === 0 ? `import(${JSON.stringify(item)})` : `.then(() => import(${JSON.stringify(item)}))`
255
+ ).join("")};
256
+ `;
257
+ }
252
258
  function writeUtoopackOverlayEntry(opts) {
253
259
  const entryPath = getOverlayEntryPath(opts.cwd, opts.entryName);
254
260
  const overlayClientPath = normalizeUtoopackPath(
@@ -258,12 +264,12 @@ function writeUtoopackOverlayEntry(opts) {
258
264
  import_fs.default.copyFileSync(UTOOPACK_OVERLAY_CLIENT_ENTRY, overlayClientPath);
259
265
  import_fs.default.writeFileSync(
260
266
  entryPath,
261
- [
267
+ createDynamicImportChain([
262
268
  getRelativeImportSpecifier(entryPath, overlayClientPath),
263
269
  ...opts.imports.map(
264
270
  (item) => getOverlayEntryImport(item, opts.cwd, entryPath)
265
271
  )
266
- ].map((item) => `import ${JSON.stringify(item)};`).join("\n") + "\n",
272
+ ]),
267
273
  "utf-8"
268
274
  );
269
275
  return entryPath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-utoopack",
3
- "version": "4.6.64",
3
+ "version": "4.6.66",
4
4
  "description": "@umijs/bundler-utoopack",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,8 +21,8 @@
21
21
  "resolve-url-loader": "5.0.0",
22
22
  "sass": "1.54.0",
23
23
  "sass-loader": "13.2.0",
24
- "@umijs/bundler-utils": "4.6.64",
25
- "@umijs/bundler-webpack": "4.6.64"
24
+ "@umijs/bundler-utils": "4.6.66",
25
+ "@umijs/bundler-webpack": "4.6.66"
26
26
  },
27
27
  "devDependencies": {
28
28
  "father": "4.1.5"