@umijs/bundler-utoopack 4.6.67 → 4.6.69
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.
- package/dist/config.d.ts +1 -1
- package/dist/config.js +13 -5
- package/dist/index.js +2 -1
- package/dist/types.d.ts +2 -2
- package/dist/util.d.ts +3 -3
- package/package.json +3 -6
package/dist/config.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare function getSSRUtooPackConfig(rawOpts: IOpts & {
|
|
|
9
9
|
useHash?: boolean;
|
|
10
10
|
isDev?: boolean;
|
|
11
11
|
}): Promise<BundleOptions>;
|
|
12
|
-
export
|
|
12
|
+
export type IDevOpts = {
|
|
13
13
|
afterMiddlewares?: any[];
|
|
14
14
|
beforeMiddlewares?: any[];
|
|
15
15
|
onDevCompileDone?: Function;
|
package/dist/config.js
CHANGED
|
@@ -356,7 +356,8 @@ function getNormalizedAlias(alias, rootDir) {
|
|
|
356
356
|
} catch (e) {
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
if (!isDirectory)
|
|
359
|
+
if (!isDirectory)
|
|
360
|
+
continue;
|
|
360
361
|
}
|
|
361
362
|
newAlias[`${key}/*`] = `${value}/*`;
|
|
362
363
|
}
|
|
@@ -404,11 +405,13 @@ function toWildcardExternalConfig(value) {
|
|
|
404
405
|
}
|
|
405
406
|
}
|
|
406
407
|
function getExternalSubPathGlob(externalKey) {
|
|
407
|
-
if (!externalKey.includes("*"))
|
|
408
|
+
if (!externalKey.includes("*"))
|
|
409
|
+
return;
|
|
408
410
|
const parts = externalKey.split("/");
|
|
409
411
|
const packageName = externalKey.startsWith("@") ? parts.slice(0, 2).join("/") : parts[0];
|
|
410
412
|
const subPathGlob = externalKey.slice(packageName.length);
|
|
411
|
-
if (!packageName || !subPathGlob.startsWith("/"))
|
|
413
|
+
if (!packageName || !subPathGlob.startsWith("/"))
|
|
414
|
+
return;
|
|
412
415
|
return {
|
|
413
416
|
packageName,
|
|
414
417
|
subPathGlob
|
|
@@ -461,9 +464,11 @@ function getNormalizedExternals(externals) {
|
|
|
461
464
|
);
|
|
462
465
|
Object.entries(externals || {}).forEach(([k, v]) => {
|
|
463
466
|
const externalSubPathGlob = getExternalSubPathGlob(k);
|
|
464
|
-
if (!externalSubPathGlob)
|
|
467
|
+
if (!externalSubPathGlob)
|
|
468
|
+
return;
|
|
465
469
|
const normalized = toWildcardExternalConfig(v);
|
|
466
|
-
if (!normalized)
|
|
470
|
+
if (!normalized)
|
|
471
|
+
return;
|
|
467
472
|
ret[externalSubPathGlob.packageName] = addWildcardSubPath(
|
|
468
473
|
ret[externalSubPathGlob.packageName] && typeof ret[externalSubPathGlob.packageName] === "object" ? ret[externalSubPathGlob.packageName] : normalized,
|
|
469
474
|
externalSubPathGlob.subPathGlob
|
|
@@ -673,6 +678,7 @@ async function getProdUtooPackConfig(rawOpts) {
|
|
|
673
678
|
},
|
|
674
679
|
define,
|
|
675
680
|
nodePolyfill: true,
|
|
681
|
+
pluginRuntimeStrategy: "childProcesses",
|
|
676
682
|
mdx: !!mdx,
|
|
677
683
|
externals: getNormalizedExternals(userExternals)
|
|
678
684
|
},
|
|
@@ -715,6 +721,7 @@ async function getSSRUtooPackConfig(rawOpts) {
|
|
|
715
721
|
target: "node",
|
|
716
722
|
sourceMaps: false,
|
|
717
723
|
stats: true,
|
|
724
|
+
pluginRuntimeStrategy: "childProcesses",
|
|
718
725
|
nodePolyfill: false,
|
|
719
726
|
optimization: {
|
|
720
727
|
...utooBundlerOpts.config.optimization,
|
|
@@ -826,6 +833,7 @@ async function getDevUtooPackConfig(rawOpts) {
|
|
|
826
833
|
// Windows persistent cache restore is currently unstable in utoopack dev.
|
|
827
834
|
persistentCaching: getDefaultPersistentCaching(),
|
|
828
835
|
nodePolyfill: true,
|
|
836
|
+
pluginRuntimeStrategy: "childProcesses",
|
|
829
837
|
mdx: !!mdx,
|
|
830
838
|
externals: getNormalizedExternals(userExternals),
|
|
831
839
|
...opts.config.clickToComponent ? {
|
package/dist/index.js
CHANGED
|
@@ -207,7 +207,8 @@ async function dev(opts) {
|
|
|
207
207
|
}
|
|
208
208
|
const publicPathPrefix = (() => {
|
|
209
209
|
const p = opts.config.publicPath;
|
|
210
|
-
if (!p || p === "/" || p === "auto")
|
|
210
|
+
if (!p || p === "/" || p === "auto")
|
|
211
|
+
return null;
|
|
211
212
|
return p.startsWith("/") ? p : "/" + p;
|
|
212
213
|
})();
|
|
213
214
|
app.use(
|
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { IOpts as IConfigOpts } from '@umijs/bundler-webpack';
|
|
2
2
|
import type { ConfigComplete } from '@utoo/pack';
|
|
3
|
-
export
|
|
3
|
+
export type IUtoopackUserConfig = ConfigComplete & {
|
|
4
4
|
babelLoader?: boolean;
|
|
5
5
|
root?: string;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type IOpts = {
|
|
8
8
|
cwd: string;
|
|
9
9
|
rootDir: string;
|
|
10
10
|
entry: Record<string, string>;
|
package/dist/util.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { WebpackConfig } from '@utoo/pack';
|
|
2
|
-
|
|
2
|
+
type IDevBannerOpts = {
|
|
3
3
|
duration?: number;
|
|
4
4
|
host?: string;
|
|
5
5
|
ip?: string;
|
|
@@ -7,7 +7,7 @@ declare type IDevBannerOpts = {
|
|
|
7
7
|
port?: number;
|
|
8
8
|
protocol: string;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type IBuildBannerOpts = {
|
|
11
11
|
assetCount?: number;
|
|
12
12
|
duration?: number;
|
|
13
13
|
outputPath?: string;
|
|
@@ -20,8 +20,8 @@ export declare function getCssOutputFilenames(opts: {
|
|
|
20
20
|
webpackConfig: WebpackConfig;
|
|
21
21
|
useHash: boolean;
|
|
22
22
|
}): {
|
|
23
|
-
cssChunkFilename: string;
|
|
24
23
|
cssFilename?: string | undefined;
|
|
24
|
+
cssChunkFilename: string;
|
|
25
25
|
};
|
|
26
26
|
export declare function getSSRCssSplitChunks(config: Record<string, any>): {
|
|
27
27
|
splitChunks?: undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/bundler-utoopack",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.69",
|
|
4
4
|
"description": "@umijs/bundler-utoopack",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -21,11 +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-
|
|
25
|
-
"@umijs/bundler-
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"father": "4.1.5"
|
|
24
|
+
"@umijs/bundler-webpack": "4.6.69",
|
|
25
|
+
"@umijs/bundler-utils": "4.6.69"
|
|
29
26
|
},
|
|
30
27
|
"publishConfig": {
|
|
31
28
|
"access": "public"
|