@modern-js/module-tools 2.40.0 → 2.42.0
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/build.d.ts +1 -1
- package/dist/build.js +6 -4
- package/dist/builder/build.d.ts +7 -7
- package/dist/builder/build.js +3 -1
- package/dist/builder/clear.d.ts +1 -2
- package/dist/builder/clear.js +2 -8
- package/dist/builder/copy.d.ts +9 -9
- package/dist/builder/dts/index.d.ts +1 -1
- package/dist/builder/dts/rollup.d.ts +1 -13
- package/dist/builder/dts/tsc.d.ts +1 -1
- package/dist/builder/dts/tsc.js +20 -15
- package/dist/builder/esbuild/adapter.d.ts +1 -1
- package/dist/builder/esbuild/hook.d.ts +1 -1
- package/dist/builder/esbuild/index.d.ts +28 -28
- package/dist/builder/esbuild/resolve.d.ts +9 -9
- package/dist/builder/esbuild/sourcemap.d.ts +14 -14
- package/dist/builder/esbuild/transform.d.ts +4 -4
- package/dist/builder/esbuild/watch.d.ts +1 -1
- package/dist/builder/esbuild/write-file.d.ts +1 -1
- package/dist/builder/feature/asset.d.ts +5 -5
- package/dist/builder/feature/format-cjs.d.ts +3 -3
- package/dist/builder/feature/index.d.ts +1 -1
- package/dist/builder/feature/json.d.ts +3 -3
- package/dist/builder/feature/redirect.d.ts +3 -3
- package/dist/builder/feature/style/index.d.ts +3 -3
- package/dist/builder/feature/style/lessAliasPlugin.d.ts +7 -7
- package/dist/builder/feature/style/lessAliasPlugin.js +3 -2
- package/dist/builder/feature/style/lessRender.d.ts +1 -1
- package/dist/builder/feature/style/postcssTransformer.d.ts +3 -3
- package/dist/builder/feature/style/postcssUrlPlugin.d.ts +3 -3
- package/dist/builder/feature/style/sassRender.d.ts +1 -1
- package/dist/builder/feature/style/transformStyle.d.ts +7 -7
- package/dist/builder/feature/style/utils.d.ts +3 -3
- package/dist/builder/feature/swc.d.ts +5 -5
- package/dist/builder/feature/terser.d.ts +3 -3
- package/dist/builder/index.d.ts +4 -4
- package/dist/builder/index.js +5 -6
- package/dist/builder/platform.d.ts +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/command.d.ts +1 -1
- package/dist/config/defineConfig.d.ts +1 -1
- package/dist/config/merge.d.ts +4 -4
- package/dist/config/normalize.d.ts +5 -6
- package/dist/config/normalize.js +2 -2
- package/dist/config/transformLegacyConfig.d.ts +1 -1
- package/dist/config/valid.d.ts +1 -1
- package/dist/constants/build.d.ts +1 -1
- package/dist/constants/color.d.ts +1 -1
- package/dist/constants/dts.d.ts +0 -1
- package/dist/constants/dts.js +0 -3
- package/dist/constants/file.d.ts +1 -1
- package/dist/constants/legacy-preset.d.ts +11 -11
- package/dist/constants/loader.d.ts +1 -1
- package/dist/constants/log.d.ts +1 -1
- package/dist/constants/preset.d.ts +5 -5
- package/dist/debug.d.ts +1 -1
- package/dist/dev.d.ts +1 -1
- package/dist/error.d.ts +19 -19
- package/dist/hooks/build.d.ts +17 -17
- package/dist/hooks/dev.d.ts +11 -11
- package/dist/hooks/index.d.ts +29 -28
- package/dist/hooks/misc.d.ts +12 -7
- package/dist/hooks/misc.js +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/locale/en.d.ts +40 -40
- package/dist/locale/index.d.ts +79 -79
- package/dist/locale/zh.d.ts +40 -40
- package/dist/plugins.d.ts +1 -1
- package/dist/types/color.d.ts +1 -1
- package/dist/types/command.d.ts +9 -9
- package/dist/types/config/copy.d.ts +10 -10
- package/dist/types/config/dev.d.ts +4 -4
- package/dist/types/config/index.d.ts +106 -106
- package/dist/types/config/style.d.ts +37 -37
- package/dist/types/context.d.ts +4 -4
- package/dist/types/dts.d.ts +39 -38
- package/dist/types/esbuild.d.ts +77 -77
- package/dist/types/hooks.d.ts +14 -14
- package/dist/types/index.d.ts +7 -7
- package/dist/types/legacyConfig/index.d.ts +8 -8
- package/dist/types/legacyConfig/output.d.ts +44 -44
- package/dist/types/legacyConfig/source.d.ts +10 -10
- package/dist/types/legacyConfig/tools.d.ts +39 -39
- package/dist/utils/assert.d.ts +1 -1
- package/dist/utils/builder.d.ts +9 -9
- package/dist/utils/common.d.ts +1 -1
- package/dist/utils/dts.d.ts +4 -34
- package/dist/utils/dts.js +71 -93
- package/dist/utils/hash.d.ts +1 -1
- package/dist/utils/index.d.ts +1 -2
- package/dist/utils/index.js +0 -2
- package/dist/utils/input.d.ts +5 -8
- package/dist/utils/log.d.ts +1 -1
- package/dist/utils/map.d.ts +5 -5
- package/dist/utils/onExit.d.ts +1 -1
- package/dist/utils/outExtension.d.ts +6 -6
- package/dist/utils/print.d.ts +3 -3
- package/dist/utils/style.d.ts +7 -7
- package/lib/types.d.ts +0 -1
- package/package.json +18 -24
- package/dist/utils/tspath.d.ts +0 -15
- package/dist/utils/tspath.js +0 -114
|
@@ -4,61 +4,61 @@ import Less from '../../../compiled/less';
|
|
|
4
4
|
type LocalsConventionFunction = (originalClassName: string, generatedClassName: string, inputFile: string) => string;
|
|
5
5
|
type GenerateScopedNameFunction = (name: string, filename: string, css: string) => string;
|
|
6
6
|
declare class Loader {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
finalSource?: string | undefined;
|
|
8
|
+
constructor(root: string, plugins: Plugin[]);
|
|
9
|
+
fetch(file: string, relativeTo: string, depTrace: string): Promise<{
|
|
10
|
+
[key: string]: string;
|
|
11
|
+
}>;
|
|
12
12
|
}
|
|
13
13
|
type AdditionalData = string | ((filePath: string) => string);
|
|
14
14
|
export type Modules = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
localsConvention?: 'camelCase' | 'camelCaseOnly' | 'dashes' | 'dashesOnly' | LocalsConventionFunction;
|
|
16
|
+
scopeBehaviour?: 'global' | 'local';
|
|
17
|
+
globalModulePaths?: RegExp[];
|
|
18
|
+
generateScopedName?: string | GenerateScopedNameFunction;
|
|
19
|
+
hashPrefix?: string;
|
|
20
|
+
exportGlobals?: boolean;
|
|
21
|
+
root?: string;
|
|
22
|
+
resolve?: (file: string) => string | Promise<string>;
|
|
23
|
+
Loader?: typeof Loader;
|
|
24
|
+
getJSON?: (cssFilename: string, json: {
|
|
25
|
+
[name: string]: string;
|
|
26
|
+
}, outputFilename?: string) => void;
|
|
27
27
|
};
|
|
28
28
|
export type AutoModules = boolean | RegExp;
|
|
29
29
|
export type LessOptions = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
additionalData?: AdditionalData;
|
|
31
|
+
implementation?: object | string;
|
|
32
|
+
lessOptions?: Less.Options;
|
|
33
33
|
};
|
|
34
34
|
export type SassOptions = {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
additionalData?: AdditionalData;
|
|
36
|
+
implementation?: object | string;
|
|
37
|
+
sassOptions?: sassOptions<'async'>;
|
|
38
38
|
};
|
|
39
39
|
export type PostcssOptions = {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
processOptions?: ProcessOptions;
|
|
41
|
+
plugins?: PostCSSPlugin[];
|
|
42
42
|
};
|
|
43
43
|
export type LessConfig = LessOptions | ((options: LessOptions) => LessOptions | void);
|
|
44
44
|
export type SassConfig = SassOptions | ((options: SassOptions) => SassOptions | void);
|
|
45
45
|
export type PostCSSConfigUtils = {
|
|
46
|
-
|
|
46
|
+
addPlugins: (plugins: PostCSSPlugin | PostCSSPlugin[]) => void;
|
|
47
47
|
};
|
|
48
48
|
export type PostCSSConfig = PostcssOptions | ((options: PostcssOptions, utils: PostCSSConfigUtils) => PostcssOptions | void);
|
|
49
49
|
export type TailwindCSSConfig = Record<string, any> | ((options: Record<string, any>) => Record<string, any> | void);
|
|
50
50
|
export interface Style extends Required<StyleConfig> {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
sass: SassOptions;
|
|
52
|
+
less: LessOptions;
|
|
53
|
+
postcss: PostcssOptions;
|
|
54
54
|
}
|
|
55
55
|
export interface StyleConfig {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
inject?: boolean;
|
|
57
|
+
sass?: SassConfig;
|
|
58
|
+
less?: LessConfig;
|
|
59
|
+
postcss?: PostCSSConfig;
|
|
60
|
+
autoModules?: boolean | RegExp;
|
|
61
|
+
modules?: Modules;
|
|
62
|
+
tailwindcss?: TailwindCSSConfig;
|
|
63
63
|
}
|
|
64
|
-
export {};
|
|
64
|
+
export {};
|
package/dist/types/context.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface ModuleContext {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
2
|
+
isTsProject: boolean;
|
|
3
|
+
appDirectory: string;
|
|
4
|
+
srcDirectory: string;
|
|
5
|
+
}
|
package/dist/types/dts.d.ts
CHANGED
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
import type { AliasOption, BaseBuildConfig, Input } from './config';
|
|
2
2
|
export interface GeneratorDtsConfig {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
appDirectory: string;
|
|
4
|
+
tsconfigPath: string;
|
|
5
|
+
watch: boolean;
|
|
6
|
+
sourceDir: string;
|
|
7
|
+
alias: AliasOption;
|
|
8
|
+
abortOnError?: boolean;
|
|
9
|
+
footer?: string;
|
|
10
|
+
banner?: string;
|
|
11
|
+
distPath: string;
|
|
12
|
+
externals: BaseBuildConfig['externals'];
|
|
13
|
+
input: Input;
|
|
14
|
+
respectExternal: boolean;
|
|
15
|
+
dtsExtension: string;
|
|
16
|
+
userTsconfig: ITsconfig;
|
|
16
17
|
}
|
|
17
18
|
export interface GeneratedDtsInfo {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
userTsconfig: ITsconfig;
|
|
20
|
+
tempTsconfigPath: string;
|
|
21
|
+
tempDistAbsRootPath: string;
|
|
22
|
+
tempDistAbsSrcPath: string;
|
|
22
23
|
}
|
|
23
24
|
export type TsTarget = 'es3' | 'es5' | 'es6' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'esnext';
|
|
24
25
|
export interface ITsconfig {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
26
|
+
compilerOptions?: {
|
|
27
|
+
rootDir?: string;
|
|
28
|
+
baseUrl?: string;
|
|
29
|
+
declaration?: boolean;
|
|
30
|
+
declarationDir?: string;
|
|
31
|
+
emitDeclarationOnly?: boolean;
|
|
32
|
+
emitDecoratorMetadata?: boolean;
|
|
33
|
+
isolatedModules?: boolean;
|
|
34
|
+
allowJs?: boolean;
|
|
35
|
+
outDir?: string;
|
|
36
|
+
paths?: Record<string, string[]>;
|
|
37
|
+
target?: TsTarget;
|
|
38
|
+
useDefineForClassFields?: boolean;
|
|
39
|
+
} | undefined;
|
|
40
|
+
include?: string[];
|
|
41
|
+
exclude?: string[];
|
|
42
|
+
extends?: string;
|
|
43
|
+
references?: {
|
|
44
|
+
path?: string;
|
|
45
|
+
}[];
|
|
46
|
+
}
|
package/dist/types/esbuild.d.ts
CHANGED
|
@@ -5,103 +5,103 @@ import { FSWatcher } from '@modern-js/utils';
|
|
|
5
5
|
import { BaseBuildConfig } from './config';
|
|
6
6
|
import { ModuleTools, PluginAPI } from '.';
|
|
7
7
|
export interface SourceMap {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
mappings: string;
|
|
9
|
+
names: string[];
|
|
10
|
+
sources: (string | null)[];
|
|
11
|
+
version: number;
|
|
12
|
+
sourcesContent?: (string | null)[];
|
|
13
13
|
}
|
|
14
14
|
export type LoadResult = Pick<OnLoadResult, 'contents' | 'loader' | 'resolveDir'> & {
|
|
15
|
-
|
|
15
|
+
map?: SourceMap;
|
|
16
16
|
};
|
|
17
17
|
export interface BuilderHooks {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Equal to esbuild#onLoad
|
|
20
|
+
*/
|
|
21
|
+
load: AsyncSeriesBailHook<[OnLoadArgs], LoadResult | undefined | void>;
|
|
22
|
+
/**
|
|
23
|
+
* Transform code after it is loaded.
|
|
24
|
+
*/
|
|
25
|
+
transform: AsyncSeriesWaterfallHook<Source>;
|
|
26
|
+
/**
|
|
27
|
+
* Modify the chunk
|
|
28
|
+
*/
|
|
29
|
+
renderChunk: AsyncSeriesWaterfallHook<[Chunk]>;
|
|
30
30
|
}
|
|
31
31
|
export type Context = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
config: BaseBuildConfig;
|
|
33
|
+
watch: boolean;
|
|
34
|
+
root: string;
|
|
35
|
+
api: PluginAPI<ModuleTools>;
|
|
36
36
|
};
|
|
37
37
|
export interface ICompiler {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
38
|
+
reBuild: (type: 'link' | 'change', config: BaseBuildConfig) => Promise<void>;
|
|
39
|
+
css_resolve: (id: string, dir: string) => string;
|
|
40
|
+
node_resolve: (id: string, dir: string, kind: ImportKind) => string | false;
|
|
41
|
+
init: () => Promise<void>;
|
|
42
|
+
watcher?: FSWatcher;
|
|
43
|
+
instance?: BuildContext;
|
|
44
|
+
result?: BuildResult;
|
|
45
|
+
reBuildCount: number;
|
|
46
|
+
buildOptions: BuildOptions;
|
|
47
|
+
context: Context;
|
|
48
|
+
config: BaseBuildConfig;
|
|
49
|
+
hooks: BuilderHooks;
|
|
50
|
+
api: PluginAPI<ModuleTools>;
|
|
51
|
+
outputChunk: Map<string, Chunk>;
|
|
52
|
+
virtualModule: Map<string, string>;
|
|
53
|
+
build: (() => Promise<void>) & (() => Promise<void>);
|
|
54
|
+
emitAsset: ((name: string, chunk: AssetChunk) => void) & ((name: string, chunk: JsChunk) => void) & ((name: string, chunk: string) => void);
|
|
55
|
+
watchedFiles: Set<string>;
|
|
56
|
+
addWatchFile: (id: string) => void;
|
|
57
|
+
getTransformContext: (path: string) => ITransformContext;
|
|
58
|
+
getSourcemapContext: (path: string) => ISourcemapContext;
|
|
59
|
+
close: () => Promise<void>;
|
|
60
60
|
}
|
|
61
61
|
export interface ISourcemapContext {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
addSourceMap: (pluginId: number, map?: SourceMap) => void;
|
|
63
|
+
getInlineSourceMap: () => string;
|
|
64
|
+
getSourceMap: () => SourceMap | undefined;
|
|
65
|
+
getSourceMapChain: () => SourceMap[];
|
|
66
|
+
genPluginId: (id: string) => number;
|
|
67
67
|
}
|
|
68
68
|
export interface ITransformContext extends ISourcemapContext {
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
addTransformResult: (pluginId: number, result: CacheValue) => void;
|
|
70
|
+
getValidCache: (pluginId: number, code: string) => undefined | CacheValue;
|
|
71
71
|
}
|
|
72
72
|
export type Source = {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
code: string;
|
|
74
|
+
map?: SourceMap;
|
|
75
|
+
path: string;
|
|
76
|
+
loader?: string;
|
|
77
77
|
};
|
|
78
78
|
export interface CacheValue extends Source {
|
|
79
|
-
|
|
79
|
+
originCode: string;
|
|
80
80
|
}
|
|
81
81
|
export type AssetChunk = {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
type: 'asset';
|
|
83
|
+
contents: string | Buffer;
|
|
84
|
+
entryPoint?: string;
|
|
85
|
+
/**
|
|
86
|
+
* absolute file path
|
|
87
|
+
*/
|
|
88
|
+
fileName: string;
|
|
89
|
+
originalFileName?: string;
|
|
90
90
|
};
|
|
91
91
|
export type JsChunk = {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
92
|
+
type: 'chunk';
|
|
93
|
+
contents: string;
|
|
94
|
+
entryPoint?: string;
|
|
95
|
+
/**
|
|
96
|
+
* absolute file path
|
|
97
|
+
*/
|
|
98
|
+
fileName: string;
|
|
99
|
+
map?: SourceMap;
|
|
100
|
+
modules?: Record<string, any>;
|
|
101
|
+
originalFileName?: string;
|
|
102
102
|
};
|
|
103
103
|
export type Chunk = AssetChunk | JsChunk;
|
|
104
104
|
export declare const enum ChunkType {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
105
|
+
chunk = "chunk",
|
|
106
|
+
asset = "asset"
|
|
107
|
+
}
|
package/dist/types/hooks.d.ts
CHANGED
|
@@ -3,29 +3,29 @@ import { registerHook } from '../hooks';
|
|
|
3
3
|
import type { BaseBuildConfig, BuildConfig, BuildType } from './config';
|
|
4
4
|
import type { DevCommandOptions, BuildCommandOptions } from './command';
|
|
5
5
|
export interface BuildTaskResult {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
status: 'success' | 'fail';
|
|
7
|
+
message?: string;
|
|
8
|
+
config: BaseBuildConfig;
|
|
9
9
|
}
|
|
10
10
|
export interface BuildResult {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
status: 'success' | 'fail';
|
|
12
|
+
message?: string;
|
|
13
|
+
config: BuildConfig;
|
|
14
|
+
commandOptions: BuildCommandOptions;
|
|
15
|
+
totalDuration: number;
|
|
16
16
|
}
|
|
17
17
|
export interface BuildPlatformResult {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
status: 'success' | 'fail';
|
|
19
|
+
message: string | Error | null;
|
|
20
20
|
}
|
|
21
21
|
export type DevToolData = BaseDevToolData<DevCommandOptions>;
|
|
22
22
|
export type PromptResult = {
|
|
23
|
-
|
|
23
|
+
choiceDevTool: string;
|
|
24
24
|
} & Record<string, any>;
|
|
25
25
|
export type ModuleToolsHooks = typeof registerHook;
|
|
26
26
|
export interface WatchJsHookContext {
|
|
27
|
-
|
|
27
|
+
buildConfig: BaseBuildConfig;
|
|
28
28
|
}
|
|
29
29
|
export interface WatchDtsHookContext {
|
|
30
|
-
|
|
31
|
-
}
|
|
30
|
+
buildType: BuildType;
|
|
31
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -11,17 +11,17 @@ export * from './context';
|
|
|
11
11
|
export * from './esbuild';
|
|
12
12
|
export type { CliPlugin, IAppContext, PluginAPI } from '@modern-js/core';
|
|
13
13
|
export type ModuleTools = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
hooks: ModuleToolsHooks;
|
|
15
|
+
userConfig: ModuleExtraConfig;
|
|
16
|
+
normalizedConfig: Required<ModuleExtraConfig>;
|
|
17
17
|
};
|
|
18
18
|
export type LegacyModuleTools = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
hooks: ModuleToolsHooks;
|
|
20
|
+
userConfig: ModuleToolsLegacyUserConfig;
|
|
21
|
+
normalizedConfig: ModuleToolsLegacyNormalizedConfig;
|
|
22
22
|
};
|
|
23
23
|
export type ModuleUserConfig = UserConfig<ModuleTools>;
|
|
24
24
|
export type ModuleLegacyUserConfig = UserConfig<LegacyModuleTools>;
|
|
25
25
|
export type ModuleNormalizedConfig = NormalizedConfig<ModuleTools>;
|
|
26
26
|
export type ModuleLegacyNormalizedConfig = NormalizedConfig<LegacyModuleTools>;
|
|
27
|
-
export type ModuleConfigParams = ModuleUserConfig | Promise<ModuleUserConfig> | ((env: any) => ModuleUserConfig | Promise<ModuleUserConfig>);
|
|
27
|
+
export type ModuleConfigParams = ModuleUserConfig | Promise<ModuleUserConfig> | ((env: any) => ModuleUserConfig | Promise<ModuleUserConfig>);
|
|
@@ -5,16 +5,16 @@ export type { OutputLegacyUserConfig } from './output';
|
|
|
5
5
|
export type { SourceLegacyUserConfig } from './source';
|
|
6
6
|
export type { ToolsLegacyUserConfig } from './tools';
|
|
7
7
|
export interface RuntimeLegacyConfig {
|
|
8
|
-
|
|
8
|
+
[name: string]: any;
|
|
9
9
|
}
|
|
10
10
|
export interface RuntimeByEntriesLegacyConfig {
|
|
11
|
-
|
|
11
|
+
[name: string]: RuntimeLegacyConfig;
|
|
12
12
|
}
|
|
13
13
|
export type ModuleToolsLegacyUserConfig = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
source?: SourceLegacyUserConfig;
|
|
15
|
+
output?: OutputLegacyUserConfig;
|
|
16
|
+
tools?: ToolsLegacyUserConfig;
|
|
17
|
+
runtime?: RuntimeLegacyConfig;
|
|
18
|
+
legacy?: boolean;
|
|
19
19
|
};
|
|
20
|
-
export type ModuleToolsLegacyNormalizedConfig = Required<ModuleToolsLegacyUserConfig>;
|
|
20
|
+
export type ModuleToolsLegacyNormalizedConfig = Required<ModuleToolsLegacyUserConfig>;
|
|
@@ -5,57 +5,57 @@ export type LegacyTarget = 'es5' | 'es6' | 'es2015' | 'es2016' | 'es2017' | 'es2
|
|
|
5
5
|
export type LegacyBuildType = 'bundle' | 'bundleless';
|
|
6
6
|
export type LegacySourceMap = boolean | 'inline' | 'external';
|
|
7
7
|
export type LegacyBundleOptions = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
entry?: Record<string, string>;
|
|
9
|
+
platform?: Platform;
|
|
10
|
+
splitting?: boolean;
|
|
11
|
+
minify?: Minify;
|
|
12
|
+
externals?: Externals;
|
|
13
|
+
skipDeps?: boolean;
|
|
14
|
+
getModuleId?: (moduleName: string) => string | undefined;
|
|
15
15
|
};
|
|
16
16
|
export type LegacyBundlelessOptions = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
sourceDir?: string;
|
|
18
|
+
style?: {
|
|
19
|
+
compileMode?: 'all' | 'only-compiled-code' | /* may be will be deprecated */ 'only-source-code' | false;
|
|
20
|
+
path?: string;
|
|
21
|
+
};
|
|
22
|
+
static?: {
|
|
23
|
+
path?: string;
|
|
24
|
+
};
|
|
25
25
|
};
|
|
26
26
|
export type LegacyBaseBuildConfig = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
format?: LegacyFormat;
|
|
28
|
+
target?: LegacyTarget;
|
|
29
|
+
sourceMap?: LegacySourceMap;
|
|
30
|
+
buildType?: LegacyBuildType;
|
|
31
|
+
bundleOptions?: LegacyBundleOptions;
|
|
32
|
+
bundlelessOptions?: LegacyBundlelessOptions;
|
|
33
|
+
tsconfig?: string;
|
|
34
|
+
enableDts?: boolean;
|
|
35
|
+
dtsOnly?: boolean;
|
|
36
|
+
outputPath?: string;
|
|
37
37
|
};
|
|
38
38
|
export type LegacyBuildConfig = LegacyBaseBuildConfig | LegacyBaseBuildConfig[];
|
|
39
39
|
export type JsSyntaxType = 'CJS+ES6' | 'ESM+ES5' | 'ESM+ES6';
|
|
40
40
|
export interface PackageFields {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
main?: JsSyntaxType;
|
|
42
|
+
'jsnext:modern'?: JsSyntaxType;
|
|
43
|
+
module?: JsSyntaxType;
|
|
44
44
|
}
|
|
45
45
|
export type OutputLegacyUserConfig = {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
};
|
|
46
|
+
jsPath?: string;
|
|
47
|
+
path?: string;
|
|
48
|
+
copy?: Array<Record<string, unknown> & {
|
|
49
|
+
from: string;
|
|
50
|
+
}>;
|
|
51
|
+
disableTsChecker?: boolean;
|
|
52
|
+
/** @deprecated Use the `buildConfig.bundlelessOptions.static.path` instead . */
|
|
53
|
+
assetsPath?: string;
|
|
54
|
+
/** @deprecated Use the `buildConfig.sourceMap` instead */
|
|
55
|
+
disableSourceMap?: boolean;
|
|
56
|
+
buildPreset?: LegacyBuildPreset;
|
|
57
|
+
buildConfig?: LegacyBuildConfig;
|
|
58
|
+
importStyle?: 'source-code' | 'compiled-code';
|
|
59
|
+
packageMode?: 'universal-js' | 'universal-js-lite' | 'browser-js' | 'browser-js-lite' | 'node-js';
|
|
60
|
+
packageFields?: PackageFields;
|
|
61
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { AliasOption } from '../config';
|
|
2
2
|
export type SourceLegacyUserConfig = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
3
|
+
alias?: AliasOption;
|
|
4
|
+
envVars?: Array<string>;
|
|
5
|
+
globalVars?: Record<string, string>;
|
|
6
|
+
jsxTransformRuntime?: 'automatic' | 'classic';
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated designSystem is no longer required.
|
|
9
|
+
* If you are using Tailwind CSS, you can now use the `theme` option of Tailwind CSS, they are the same.
|
|
10
|
+
*/
|
|
11
|
+
designSystem?: Record<string, any>;
|
|
12
|
+
};
|