dumi 2.4.27 → 2.4.28
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.
|
@@ -230,7 +230,7 @@ var compile_default = (api) => {
|
|
|
230
230
|
...memo.utoopack.module || {},
|
|
231
231
|
rules: {
|
|
232
232
|
...((_a = memo.utoopack.module) == null ? void 0 : _a.rules) || {},
|
|
233
|
-
...(0, import_utoopackLoaders.getUtoopackRules)(api)
|
|
233
|
+
...(0, import_utoopackLoaders.getUtoopackRules)(api, memo)
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
};
|
|
@@ -5,4 +5,4 @@ export declare function buildLoaderContextContent(techStacks: IDumiTechStack[],
|
|
|
5
5
|
specifier: string;
|
|
6
6
|
source: string;
|
|
7
7
|
}>, routes?: Record<string, unknown>): string;
|
|
8
|
-
export declare const getUtoopackRules: (api: IApi) => Record<string, unknown>;
|
|
8
|
+
export declare const getUtoopackRules: (api: IApi, config?: IApi['config']) => Record<string, unknown>;
|
|
@@ -85,16 +85,16 @@ exports.builtins = ${JSON.stringify(builtins)};
|
|
|
85
85
|
exports.routes = ${JSON.stringify(routes)};
|
|
86
86
|
`;
|
|
87
87
|
}
|
|
88
|
-
var getUtoopackRules = (api) => {
|
|
88
|
+
var getUtoopackRules = (api, config = api.config) => {
|
|
89
89
|
const disableLiveDemo = (0, import_utils.shouldDisabledLiveDemo)(api);
|
|
90
90
|
const loaderContextPath = import_path.default.join(
|
|
91
91
|
api.paths.absTmpPath,
|
|
92
92
|
LOADER_CTX_FILENAME
|
|
93
93
|
);
|
|
94
|
-
const cfgResolve =
|
|
94
|
+
const cfgResolve = config.resolve ?? {};
|
|
95
95
|
const serializableBaseOpts = toSerializable({
|
|
96
96
|
cwd: api.cwd,
|
|
97
|
-
alias:
|
|
97
|
+
alias: config.alias || {},
|
|
98
98
|
resolve: {
|
|
99
99
|
atomDirs: cfgResolve.atomDirs ?? [{ type: "component", dir: "src" }],
|
|
100
100
|
docDirs: cfgResolve.docDirs ?? ["docs"],
|
|
@@ -104,7 +104,7 @@ var getUtoopackRules = (api) => {
|
|
|
104
104
|
},
|
|
105
105
|
routes: {},
|
|
106
106
|
builtins: {},
|
|
107
|
-
locales:
|
|
107
|
+
locales: config.locales || [],
|
|
108
108
|
pkg: api.pkg,
|
|
109
109
|
disableLiveDemo,
|
|
110
110
|
[UTOOPACK_LOADER_CTX_KEY]: loaderContextPath
|