@empjs/cli 3.1.0-rc.7 → 3.1.0-rc.9
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/index.cjs +17 -2973
- package/dist/index.d.cts +3 -129
- package/dist/index.d.ts +3 -129
- package/dist/index.js +17 -2951
- package/package.json +6 -6
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,44 +1,14 @@
|
|
|
1
1
|
import { InspectOptions } from 'node:util';
|
|
2
2
|
import { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin';
|
|
3
3
|
import * as _rspack_core from '@rspack/core';
|
|
4
|
-
import {
|
|
4
|
+
import { Output, Configuration, RspackOptions, Externals, Resolve, DevServer, SwcJsMinimizerRspackPluginOptions, LightningCssMinimizerRspackPluginOptions, HtmlRspackPluginOptions, RuleSetRule } from '@rspack/core';
|
|
5
5
|
export { rspack } from '@rspack/core';
|
|
6
6
|
import { Options } from 'sass-embedded';
|
|
7
|
-
import { ModuleFederationPlugin } from '@module-federation/enhanced/rspack';
|
|
8
7
|
import WPChain from 'webpack-chain';
|
|
9
|
-
export { default as HtmlWebpackPlugin } from 'html-webpack-plugin';
|
|
10
8
|
import * as chalk from 'chalk';
|
|
11
9
|
import chalk__default from 'chalk';
|
|
12
10
|
import { glob } from 'glob';
|
|
13
11
|
|
|
14
|
-
type externalAssetsType = {
|
|
15
|
-
js: string[];
|
|
16
|
-
css: string[];
|
|
17
|
-
};
|
|
18
|
-
type ModuleFederationPluginOptions = ConstructorParameters<typeof ModuleFederationPlugin>[0];
|
|
19
|
-
type ImportMapType = {
|
|
20
|
-
imports: {
|
|
21
|
-
[key: string]: any;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
declare class EMPShareLib {
|
|
25
|
-
externals: Configuration['externals'] | any;
|
|
26
|
-
externalAssets: externalAssetsType;
|
|
27
|
-
private exp;
|
|
28
|
-
config: EMPShareType;
|
|
29
|
-
importMap: ImportMapType;
|
|
30
|
-
isEmpshare: boolean;
|
|
31
|
-
setup(): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* 是否取用 importMap
|
|
34
|
-
*/
|
|
35
|
-
get useImportMap(): boolean | undefined;
|
|
36
|
-
get pluginConfig(): ModuleFederationPluginOptions;
|
|
37
|
-
prepareEsm(): void;
|
|
38
|
-
setShareLib(): Promise<void>;
|
|
39
|
-
private setExternalAssets;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
12
|
type LifeCycleOptions = Partial<LifeCycle>;
|
|
43
13
|
declare class LifeCycle {
|
|
44
14
|
op: LifeCycleOptions;
|
|
@@ -126,24 +96,6 @@ declare namespace utils {
|
|
|
126
96
|
export { utils_clearConsole as clearConsole, utils_deepAssign as deepAssign, utils_ensureArray as ensureArray, utils_getLanIp as getLanIp, utils_getPkgVersion as getPkgVersion, utils_importJsVm as importJsVm, utils_jsonFilter as jsonFilter, utils_timeFormat as timeFormat, utils_vCompare as vCompare };
|
|
127
97
|
}
|
|
128
98
|
|
|
129
|
-
declare class EmpShareFastMode {
|
|
130
|
-
fastMode: Required<EMPShareFastModeType>;
|
|
131
|
-
externalMF: {
|
|
132
|
-
'@module-federation/runtime': string;
|
|
133
|
-
'@module-federation/sdk': string;
|
|
134
|
-
};
|
|
135
|
-
externalReact: {
|
|
136
|
-
react: string;
|
|
137
|
-
'react-dom': string;
|
|
138
|
-
'react-router-dom': string;
|
|
139
|
-
};
|
|
140
|
-
externals: any;
|
|
141
|
-
getRuntimeLib(runtimeHost: string): string;
|
|
142
|
-
setup(): void;
|
|
143
|
-
injectLib(): void;
|
|
144
|
-
setExternals(): void;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
99
|
declare class EmpConfig {
|
|
148
100
|
private store;
|
|
149
101
|
/**
|
|
@@ -166,8 +118,6 @@ declare class EmpConfig {
|
|
|
166
118
|
base: string;
|
|
167
119
|
target: RsTarget;
|
|
168
120
|
private assign;
|
|
169
|
-
empShareFastMode: EmpShareFastMode;
|
|
170
|
-
empShareLib: EMPShareLib;
|
|
171
121
|
/**
|
|
172
122
|
* 是否启动 esm 模块
|
|
173
123
|
* @default true
|
|
@@ -184,14 +134,13 @@ declare class EmpConfig {
|
|
|
184
134
|
get html(): HtmlType;
|
|
185
135
|
get entries(): EntriesType;
|
|
186
136
|
get server(): ServerType;
|
|
187
|
-
get empShare(): EMPShareType;
|
|
188
137
|
get css(): Required<EmpOptions['css']>;
|
|
189
138
|
get output(): Output;
|
|
190
139
|
get define(): {
|
|
191
140
|
[k: string]: string;
|
|
192
141
|
};
|
|
193
142
|
private setDefine;
|
|
194
|
-
get externals():
|
|
143
|
+
get externals(): {};
|
|
195
144
|
get resolve(): _rspack_core.ResolveOptions;
|
|
196
145
|
syncEmpOptions(): Promise<void>;
|
|
197
146
|
get moduleTransformRule(): any;
|
|
@@ -287,15 +236,8 @@ declare class GlobalStore {
|
|
|
287
236
|
define: string;
|
|
288
237
|
copy: string;
|
|
289
238
|
progress: string;
|
|
290
|
-
empShare: string;
|
|
291
239
|
html: {
|
|
292
240
|
prefix: string;
|
|
293
|
-
empSharePrefix: string;
|
|
294
|
-
importMapPrefix: string;
|
|
295
|
-
hooks: {
|
|
296
|
-
empShareLib: string;
|
|
297
|
-
importMap: string;
|
|
298
|
-
};
|
|
299
241
|
};
|
|
300
242
|
rsdoctor: string;
|
|
301
243
|
};
|
|
@@ -376,6 +318,7 @@ type DebugType = {
|
|
|
376
318
|
rspackCache?: boolean;
|
|
377
319
|
rsdoctor?: boolean | RsdoctorRspackPluginOptions;
|
|
378
320
|
newTreeshaking?: boolean;
|
|
321
|
+
devShowAllLog?: boolean;
|
|
379
322
|
/**
|
|
380
323
|
* 是否显示执行日志
|
|
381
324
|
* @default false
|
|
@@ -507,30 +450,6 @@ interface HtmlType extends HtmlRspackPluginOptions {
|
|
|
507
450
|
* @default src/favicon.ico
|
|
508
451
|
*/
|
|
509
452
|
favicon?: string;
|
|
510
|
-
/**
|
|
511
|
-
* 网站语言
|
|
512
|
-
*/
|
|
513
|
-
lang?: string;
|
|
514
|
-
/**
|
|
515
|
-
* externals 文件插入到html
|
|
516
|
-
*/
|
|
517
|
-
files?: {
|
|
518
|
-
/**
|
|
519
|
-
* 插入 css
|
|
520
|
-
*/
|
|
521
|
-
css?: string[];
|
|
522
|
-
/**
|
|
523
|
-
* 插入 js
|
|
524
|
-
*/
|
|
525
|
-
js?: string[];
|
|
526
|
-
};
|
|
527
|
-
/**
|
|
528
|
-
* 自定义 头部脚步内容 headTags[] bodyTags[]
|
|
529
|
-
*/
|
|
530
|
-
tags?: {
|
|
531
|
-
headTags?: any[];
|
|
532
|
-
bodyTags?: any[];
|
|
533
|
-
};
|
|
534
453
|
}
|
|
535
454
|
type EntriesType = {
|
|
536
455
|
[entryFilename: string]: HtmlType;
|
|
@@ -550,50 +469,6 @@ type CssSassOptionsType = {
|
|
|
550
469
|
mode?: 'default' | 'modern' | 'legacy';
|
|
551
470
|
implementation?: object | string;
|
|
552
471
|
};
|
|
553
|
-
type EMPShareFastModeType = {
|
|
554
|
-
/**
|
|
555
|
-
* 共享库目录 优先读取 runtimeLib
|
|
556
|
-
*/
|
|
557
|
-
runtimeHost?: string;
|
|
558
|
-
/**
|
|
559
|
-
* 共享库全路径
|
|
560
|
-
*/
|
|
561
|
-
runtimeLib?: string;
|
|
562
|
-
/**
|
|
563
|
-
* 额外的库添加
|
|
564
|
-
*/
|
|
565
|
-
externals?: any;
|
|
566
|
-
/**
|
|
567
|
-
* 当为 UMD时 暴露到 window 的全局变量
|
|
568
|
-
*/
|
|
569
|
-
globalVal?: string;
|
|
570
|
-
/**
|
|
571
|
-
* 默认支持React
|
|
572
|
-
*/
|
|
573
|
-
framework?: 'react' | '';
|
|
574
|
-
};
|
|
575
|
-
type EMPShareType = ModuleFederationPluginOptions & {
|
|
576
|
-
/**
|
|
577
|
-
* emp 基于库共享模块
|
|
578
|
-
*/
|
|
579
|
-
shareLib?: EMPshareLibItemType;
|
|
580
|
-
/**
|
|
581
|
-
* TODO
|
|
582
|
-
* 是否使用 importMap
|
|
583
|
-
*/
|
|
584
|
-
useImportMap?: boolean;
|
|
585
|
-
/**
|
|
586
|
-
* 快速模式
|
|
587
|
-
*/
|
|
588
|
-
fastMode?: EMPShareFastModeType;
|
|
589
|
-
};
|
|
590
|
-
type EMPshareLibItemType = {
|
|
591
|
-
[module: string]: {
|
|
592
|
-
entry: string;
|
|
593
|
-
global?: string;
|
|
594
|
-
type?: 'js' | 'css';
|
|
595
|
-
} | string | string[];
|
|
596
|
-
};
|
|
597
472
|
type RsTarget = Configuration['target'];
|
|
598
473
|
type AutoPagesType = {
|
|
599
474
|
/**
|
|
@@ -641,7 +516,6 @@ type EmpOptions = {
|
|
|
641
516
|
server?: ServerType;
|
|
642
517
|
debug?: DebugType;
|
|
643
518
|
chain?: (chain: WPChain) => void;
|
|
644
|
-
empShare?: EMPShareType;
|
|
645
519
|
/**
|
|
646
520
|
* css 相关设置
|
|
647
521
|
* @argument sass default {mode: 'modern'}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,44 +1,14 @@
|
|
|
1
1
|
import { InspectOptions } from 'node:util';
|
|
2
2
|
import { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin';
|
|
3
3
|
import * as _rspack_core from '@rspack/core';
|
|
4
|
-
import {
|
|
4
|
+
import { Output, Configuration, RspackOptions, Externals, Resolve, DevServer, SwcJsMinimizerRspackPluginOptions, LightningCssMinimizerRspackPluginOptions, HtmlRspackPluginOptions, RuleSetRule } from '@rspack/core';
|
|
5
5
|
export { rspack } from '@rspack/core';
|
|
6
6
|
import { Options } from 'sass-embedded';
|
|
7
|
-
import { ModuleFederationPlugin } from '@module-federation/enhanced/rspack';
|
|
8
7
|
import WPChain from 'webpack-chain';
|
|
9
|
-
export { default as HtmlWebpackPlugin } from 'html-webpack-plugin';
|
|
10
8
|
import * as chalk from 'chalk';
|
|
11
9
|
import chalk__default from 'chalk';
|
|
12
10
|
import { glob } from 'glob';
|
|
13
11
|
|
|
14
|
-
type externalAssetsType = {
|
|
15
|
-
js: string[];
|
|
16
|
-
css: string[];
|
|
17
|
-
};
|
|
18
|
-
type ModuleFederationPluginOptions = ConstructorParameters<typeof ModuleFederationPlugin>[0];
|
|
19
|
-
type ImportMapType = {
|
|
20
|
-
imports: {
|
|
21
|
-
[key: string]: any;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
declare class EMPShareLib {
|
|
25
|
-
externals: Configuration['externals'] | any;
|
|
26
|
-
externalAssets: externalAssetsType;
|
|
27
|
-
private exp;
|
|
28
|
-
config: EMPShareType;
|
|
29
|
-
importMap: ImportMapType;
|
|
30
|
-
isEmpshare: boolean;
|
|
31
|
-
setup(): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* 是否取用 importMap
|
|
34
|
-
*/
|
|
35
|
-
get useImportMap(): boolean | undefined;
|
|
36
|
-
get pluginConfig(): ModuleFederationPluginOptions;
|
|
37
|
-
prepareEsm(): void;
|
|
38
|
-
setShareLib(): Promise<void>;
|
|
39
|
-
private setExternalAssets;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
12
|
type LifeCycleOptions = Partial<LifeCycle>;
|
|
43
13
|
declare class LifeCycle {
|
|
44
14
|
op: LifeCycleOptions;
|
|
@@ -126,24 +96,6 @@ declare namespace utils {
|
|
|
126
96
|
export { utils_clearConsole as clearConsole, utils_deepAssign as deepAssign, utils_ensureArray as ensureArray, utils_getLanIp as getLanIp, utils_getPkgVersion as getPkgVersion, utils_importJsVm as importJsVm, utils_jsonFilter as jsonFilter, utils_timeFormat as timeFormat, utils_vCompare as vCompare };
|
|
127
97
|
}
|
|
128
98
|
|
|
129
|
-
declare class EmpShareFastMode {
|
|
130
|
-
fastMode: Required<EMPShareFastModeType>;
|
|
131
|
-
externalMF: {
|
|
132
|
-
'@module-federation/runtime': string;
|
|
133
|
-
'@module-federation/sdk': string;
|
|
134
|
-
};
|
|
135
|
-
externalReact: {
|
|
136
|
-
react: string;
|
|
137
|
-
'react-dom': string;
|
|
138
|
-
'react-router-dom': string;
|
|
139
|
-
};
|
|
140
|
-
externals: any;
|
|
141
|
-
getRuntimeLib(runtimeHost: string): string;
|
|
142
|
-
setup(): void;
|
|
143
|
-
injectLib(): void;
|
|
144
|
-
setExternals(): void;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
99
|
declare class EmpConfig {
|
|
148
100
|
private store;
|
|
149
101
|
/**
|
|
@@ -166,8 +118,6 @@ declare class EmpConfig {
|
|
|
166
118
|
base: string;
|
|
167
119
|
target: RsTarget;
|
|
168
120
|
private assign;
|
|
169
|
-
empShareFastMode: EmpShareFastMode;
|
|
170
|
-
empShareLib: EMPShareLib;
|
|
171
121
|
/**
|
|
172
122
|
* 是否启动 esm 模块
|
|
173
123
|
* @default true
|
|
@@ -184,14 +134,13 @@ declare class EmpConfig {
|
|
|
184
134
|
get html(): HtmlType;
|
|
185
135
|
get entries(): EntriesType;
|
|
186
136
|
get server(): ServerType;
|
|
187
|
-
get empShare(): EMPShareType;
|
|
188
137
|
get css(): Required<EmpOptions['css']>;
|
|
189
138
|
get output(): Output;
|
|
190
139
|
get define(): {
|
|
191
140
|
[k: string]: string;
|
|
192
141
|
};
|
|
193
142
|
private setDefine;
|
|
194
|
-
get externals():
|
|
143
|
+
get externals(): {};
|
|
195
144
|
get resolve(): _rspack_core.ResolveOptions;
|
|
196
145
|
syncEmpOptions(): Promise<void>;
|
|
197
146
|
get moduleTransformRule(): any;
|
|
@@ -287,15 +236,8 @@ declare class GlobalStore {
|
|
|
287
236
|
define: string;
|
|
288
237
|
copy: string;
|
|
289
238
|
progress: string;
|
|
290
|
-
empShare: string;
|
|
291
239
|
html: {
|
|
292
240
|
prefix: string;
|
|
293
|
-
empSharePrefix: string;
|
|
294
|
-
importMapPrefix: string;
|
|
295
|
-
hooks: {
|
|
296
|
-
empShareLib: string;
|
|
297
|
-
importMap: string;
|
|
298
|
-
};
|
|
299
241
|
};
|
|
300
242
|
rsdoctor: string;
|
|
301
243
|
};
|
|
@@ -376,6 +318,7 @@ type DebugType = {
|
|
|
376
318
|
rspackCache?: boolean;
|
|
377
319
|
rsdoctor?: boolean | RsdoctorRspackPluginOptions;
|
|
378
320
|
newTreeshaking?: boolean;
|
|
321
|
+
devShowAllLog?: boolean;
|
|
379
322
|
/**
|
|
380
323
|
* 是否显示执行日志
|
|
381
324
|
* @default false
|
|
@@ -507,30 +450,6 @@ interface HtmlType extends HtmlRspackPluginOptions {
|
|
|
507
450
|
* @default src/favicon.ico
|
|
508
451
|
*/
|
|
509
452
|
favicon?: string;
|
|
510
|
-
/**
|
|
511
|
-
* 网站语言
|
|
512
|
-
*/
|
|
513
|
-
lang?: string;
|
|
514
|
-
/**
|
|
515
|
-
* externals 文件插入到html
|
|
516
|
-
*/
|
|
517
|
-
files?: {
|
|
518
|
-
/**
|
|
519
|
-
* 插入 css
|
|
520
|
-
*/
|
|
521
|
-
css?: string[];
|
|
522
|
-
/**
|
|
523
|
-
* 插入 js
|
|
524
|
-
*/
|
|
525
|
-
js?: string[];
|
|
526
|
-
};
|
|
527
|
-
/**
|
|
528
|
-
* 自定义 头部脚步内容 headTags[] bodyTags[]
|
|
529
|
-
*/
|
|
530
|
-
tags?: {
|
|
531
|
-
headTags?: any[];
|
|
532
|
-
bodyTags?: any[];
|
|
533
|
-
};
|
|
534
453
|
}
|
|
535
454
|
type EntriesType = {
|
|
536
455
|
[entryFilename: string]: HtmlType;
|
|
@@ -550,50 +469,6 @@ type CssSassOptionsType = {
|
|
|
550
469
|
mode?: 'default' | 'modern' | 'legacy';
|
|
551
470
|
implementation?: object | string;
|
|
552
471
|
};
|
|
553
|
-
type EMPShareFastModeType = {
|
|
554
|
-
/**
|
|
555
|
-
* 共享库目录 优先读取 runtimeLib
|
|
556
|
-
*/
|
|
557
|
-
runtimeHost?: string;
|
|
558
|
-
/**
|
|
559
|
-
* 共享库全路径
|
|
560
|
-
*/
|
|
561
|
-
runtimeLib?: string;
|
|
562
|
-
/**
|
|
563
|
-
* 额外的库添加
|
|
564
|
-
*/
|
|
565
|
-
externals?: any;
|
|
566
|
-
/**
|
|
567
|
-
* 当为 UMD时 暴露到 window 的全局变量
|
|
568
|
-
*/
|
|
569
|
-
globalVal?: string;
|
|
570
|
-
/**
|
|
571
|
-
* 默认支持React
|
|
572
|
-
*/
|
|
573
|
-
framework?: 'react' | '';
|
|
574
|
-
};
|
|
575
|
-
type EMPShareType = ModuleFederationPluginOptions & {
|
|
576
|
-
/**
|
|
577
|
-
* emp 基于库共享模块
|
|
578
|
-
*/
|
|
579
|
-
shareLib?: EMPshareLibItemType;
|
|
580
|
-
/**
|
|
581
|
-
* TODO
|
|
582
|
-
* 是否使用 importMap
|
|
583
|
-
*/
|
|
584
|
-
useImportMap?: boolean;
|
|
585
|
-
/**
|
|
586
|
-
* 快速模式
|
|
587
|
-
*/
|
|
588
|
-
fastMode?: EMPShareFastModeType;
|
|
589
|
-
};
|
|
590
|
-
type EMPshareLibItemType = {
|
|
591
|
-
[module: string]: {
|
|
592
|
-
entry: string;
|
|
593
|
-
global?: string;
|
|
594
|
-
type?: 'js' | 'css';
|
|
595
|
-
} | string | string[];
|
|
596
|
-
};
|
|
597
472
|
type RsTarget = Configuration['target'];
|
|
598
473
|
type AutoPagesType = {
|
|
599
474
|
/**
|
|
@@ -641,7 +516,6 @@ type EmpOptions = {
|
|
|
641
516
|
server?: ServerType;
|
|
642
517
|
debug?: DebugType;
|
|
643
518
|
chain?: (chain: WPChain) => void;
|
|
644
|
-
empShare?: EMPShareType;
|
|
645
519
|
/**
|
|
646
520
|
* css 相关设置
|
|
647
521
|
* @argument sass default {mode: 'modern'}
|