支持module.rules
This commit is contained in:
parent
165fba6628
commit
7afe4f9583
|
|
@ -293,6 +293,11 @@ module.exports = function (webpackEnv) {
|
|||
type: 'javascript/auto',
|
||||
use: [oakFileLoader('wxml')],
|
||||
},
|
||||
...(projectConfiguration &&
|
||||
projectConfiguration.module &&
|
||||
projectConfiguration.module.rules
|
||||
? projectConfiguration.module.rules : []
|
||||
),
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ type ExternalsType = Required<WebpackConfiguration>['externals'];
|
|||
type ExternalsObjectType = Exclude<ExternalsType, RegExp | string | Function | Array<any>>;
|
||||
type PluginType = Required<WebpackConfiguration>['plugins'];
|
||||
type PluginInstanceType = PluginType extends Array<infer T> ? Exclude<T, false | number | string | null | undefined> : never;
|
||||
type ModuleType = Required<WebpackConfiguration>['module'];
|
||||
type RuleType = Required<ModuleType>['rules'];
|
||||
type RuleObjectType = RuleType extends Array<infer T> ? Exclude<T, false | number | string | null | undefined> : never;
|
||||
/**
|
||||
* 编译环境配置
|
||||
*/
|
||||
|
|
@ -23,6 +26,9 @@ export type CompilerConfiguration = {
|
|||
cacheGroups: CacheGroups;
|
||||
};
|
||||
externals?: ExternalsObjectType;
|
||||
module: {
|
||||
rules: RuleObjectType[];
|
||||
};
|
||||
plugins?: PluginInstanceType[];
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,7 +10,10 @@ type CacheGroups = Exclude<SplitChunks, false>["cacheGroups"];
|
|||
type ExternalsType = Required<WebpackConfiguration>['externals'];
|
||||
type ExternalsObjectType = Exclude<ExternalsType, RegExp | string | Function | Array<any>>;
|
||||
type PluginType = Required<WebpackConfiguration>['plugins'];
|
||||
type PluginInstanceType = PluginType extends Array<infer T> ? Exclude<T, false| number | string | null | undefined> : never
|
||||
type PluginInstanceType = PluginType extends Array<infer T> ? Exclude<T, false | number | string | null | undefined> : never
|
||||
type ModuleType = Required < WebpackConfiguration > ['module'];
|
||||
type RuleType = Required<ModuleType>['rules'];
|
||||
type RuleObjectType = RuleType extends Array<infer T> ? Exclude<T, false | number | string | null | undefined> : never
|
||||
|
||||
/**
|
||||
* 编译环境配置
|
||||
|
|
@ -26,6 +29,9 @@ export type CompilerConfiguration = {
|
|||
cacheGroups: CacheGroups;
|
||||
},
|
||||
externals?: ExternalsObjectType;
|
||||
module: {
|
||||
rules: RuleObjectType[];
|
||||
}
|
||||
plugins?: PluginInstanceType[];
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue