@umijs/bundler-utoopack 4.6.35 → 4.6.36

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 +19 -8
  2. package/package.json +4 -4
package/dist/config.js CHANGED
@@ -183,7 +183,7 @@ function getSvgModuleRules(opts) {
183
183
  };
184
184
  }
185
185
  async function getProdUtooPackConfig(opts) {
186
- var _a;
186
+ var _a, _b;
187
187
  const webpackConfig = await (0, import_bundler_webpack.getConfig)({
188
188
  cwd: opts.cwd,
189
189
  rootDir: opts.rootDir,
@@ -228,6 +228,10 @@ async function getProdUtooPackConfig(opts) {
228
228
  svgo = {},
229
229
  inlineLimit
230
230
  } = opts.config;
231
+ let crossOriginLoading = false;
232
+ if ((_a = webpackConfig.output) == null ? void 0 : _a.crossOriginLoading) {
233
+ crossOriginLoading = webpackConfig.output.crossOriginLoading;
234
+ }
231
235
  utooBundlerOpts = {
232
236
  ...utooBundlerOpts,
233
237
  config: import_utils.lodash.merge(
@@ -236,7 +240,8 @@ async function getProdUtooPackConfig(opts) {
236
240
  output: {
237
241
  clean: opts.clean,
238
242
  publicPath: runtimePublicPath ? "runtime" : publicPath || "/",
239
- ...opts.disableCopy ? { copy: [] } : { copy: ["public"].concat(copy) }
243
+ ...opts.disableCopy ? { copy: [] } : { copy: ["public"].concat(copy) },
244
+ crossOriginLoading
240
245
  },
241
246
  optimization: {
242
247
  modularizeImports,
@@ -244,7 +249,7 @@ async function getProdUtooPackConfig(opts) {
244
249
  },
245
250
  resolve: {
246
251
  alias: getNormalizedAlias(
247
- (_a = utooBundlerOpts.config.resolve) == null ? void 0 : _a.alias,
252
+ (_b = utooBundlerOpts.config.resolve) == null ? void 0 : _b.alias,
248
253
  opts.rootDir
249
254
  )
250
255
  },
@@ -271,7 +276,7 @@ async function getProdUtooPackConfig(opts) {
271
276
  return utooBundlerOpts;
272
277
  }
273
278
  async function getDevUtooPackConfig(opts) {
274
- var _a;
279
+ var _a, _b;
275
280
  let webpackConfig = await (0, import_bundler_webpack.getConfig)({
276
281
  cwd: opts.cwd,
277
282
  rootDir: opts.rootDir,
@@ -316,7 +321,10 @@ async function getDevUtooPackConfig(opts) {
316
321
  svgo = {},
317
322
  inlineLimit
318
323
  } = opts.config;
319
- const normalizedExternals = getNormalizedExternals(userExternals);
324
+ let crossOriginLoading = false;
325
+ if ((_a = webpackConfig.output) == null ? void 0 : _a.crossOriginLoading) {
326
+ crossOriginLoading = webpackConfig.output.crossOriginLoading;
327
+ }
320
328
  utooBundlerOpts = {
321
329
  ...utooBundlerOpts,
322
330
  config: import_utils.lodash.merge(
@@ -326,11 +334,12 @@ async function getDevUtooPackConfig(opts) {
326
334
  // utoopack 的 dev 需要默认清空产物目录
327
335
  clean: opts.clean === void 0 ? true : opts.clean,
328
336
  publicPath: runtimePublicPath ? "runtime" : publicPath || "/",
329
- ...opts.disableCopy ? { copy: [] } : { copy: ["public"].concat(copy) }
337
+ ...opts.disableCopy ? { copy: [] } : { copy: ["public"].concat(copy) },
338
+ crossOriginLoading
330
339
  },
331
340
  resolve: {
332
341
  alias: getNormalizedAlias(
333
- (_a = utooBundlerOpts.config.resolve) == null ? void 0 : _a.alias,
342
+ (_b = utooBundlerOpts.config.resolve) == null ? void 0 : _b.alias,
334
343
  opts.rootDir
335
344
  )
336
345
  },
@@ -350,8 +359,10 @@ async function getDevUtooPackConfig(opts) {
350
359
  define: {
351
360
  "process.env": JSON.stringify(processEnvForUtoopack)
352
361
  },
362
+ // dev enable persistent cache by default
363
+ persistentCaching: true,
353
364
  nodePolyfill: true,
354
- externals: normalizedExternals,
365
+ externals: getNormalizedExternals(userExternals),
355
366
  ...getSvgModuleRules({ svgr, svgo, inlineLimit })
356
367
  },
357
368
  opts.config.utoopack || {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-utoopack",
3
- "version": "4.6.35",
3
+ "version": "4.6.36",
4
4
  "description": "@umijs/bundler-utoopack",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,7 +8,7 @@
8
8
  "dist"
9
9
  ],
10
10
  "dependencies": {
11
- "@utoo/pack": "1.3.4",
11
+ "@utoo/pack": "1.3.6",
12
12
  "compression": "^1.7.4",
13
13
  "connect-history-api-fallback": "^2.0.0",
14
14
  "cors": "^2.8.5",
@@ -19,8 +19,8 @@
19
19
  "postcss": "^8.4.21",
20
20
  "sass": "1.54.0",
21
21
  "sass-loader": "13.2.0",
22
- "@umijs/bundler-webpack": "4.6.35",
23
- "@umijs/bundler-utils": "4.6.35"
22
+ "@umijs/bundler-utils": "4.6.36",
23
+ "@umijs/bundler-webpack": "4.6.36"
24
24
  },
25
25
  "devDependencies": {
26
26
  "father": "4.1.5"