@modern-js/module-tools 2.17.1 → 2.18.1
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @modern-js/module-tools
|
|
2
2
|
|
|
3
|
+
## 2.18.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- cdc9db1: fix(module-tools, plugin-tailwindcss): fix `style.tailwindcss` config name and merge logic
|
|
8
|
+
fix(module-tools, plugin-tailwindcss): 修复 `style.tailwindcss` 错误的配置名和合并逻辑
|
|
9
|
+
- b161968: chore: fix libuild version
|
|
10
|
+
chore: 锁定 libuild 版本号
|
|
11
|
+
- Updated dependencies [21c87bf]
|
|
12
|
+
- Updated dependencies [bc61dab]
|
|
13
|
+
- @modern-js/new-action@2.18.1
|
|
14
|
+
- @modern-js/upgrade@2.18.1
|
|
15
|
+
- @modern-js/core@2.18.1
|
|
16
|
+
- @modern-js/plugin-changeset@2.18.1
|
|
17
|
+
- @modern-js/plugin-i18n@2.18.1
|
|
18
|
+
- @modern-js/plugin-lint@2.18.1
|
|
19
|
+
- @modern-js/plugin@2.18.1
|
|
20
|
+
- @modern-js/utils@2.18.1
|
|
21
|
+
|
|
22
|
+
## 2.18.0
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- f65d3e8: chore: update libuild version
|
|
27
|
+
chore: 更新 libuild 版本
|
|
28
|
+
- @modern-js/core@2.18.0
|
|
29
|
+
- @modern-js/plugin-changeset@2.18.0
|
|
30
|
+
- @modern-js/plugin-i18n@2.18.0
|
|
31
|
+
- @modern-js/plugin-lint@2.18.0
|
|
32
|
+
- @modern-js/new-action@2.18.0
|
|
33
|
+
- @modern-js/plugin@2.18.0
|
|
34
|
+
- @modern-js/upgrade@2.18.0
|
|
35
|
+
- @modern-js/utils@2.18.0
|
|
36
|
+
|
|
3
37
|
## 2.17.1
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
package/dist/constants/build.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;+BAEaA;;aAAAA;;AAAN,MAAMA,qBAAqBC,OAAOC,OAAwB;EAC/DC,WAAW;EACXC,QAAQ;EACRC,QAAQ;EACRC,WAAW;EACXC,MAAM,CAAC;EACPC,QAAQ;EACRC,KAAKR,OAAOC,OAAO;IACjBQ,MAAM;IACNC,UAAU;IACVC,cAAc;IACdC,cAAc;EAChB;EACAC,KAAK;EACLC,OAAO;IAAC;;EACRC,UAAU;EACVC,WAAW;EACXC,WAAW;EACXC,QAAQ;EACRC,cAAc;EACdC,YAAY,CAAC;EACbC,WAAW;EACXC,OAAO,CAAC;EACRC,UAAU;EACVC,eAAeC,UAAQA;EACvBC,QAAQ,CAAC;EACTC,OAAO;IACLC,MAAM;IACNC,OAAO;IACPC,YAAY;IACZC,MAAM;EACR;EACAC,OAAO;IACLC,MAAM,CAAC;IACPC,MAAM,CAAC;IACPC,SAAS,CAAC;IACVC,aAAa,CAAC;IACdC,QAAQ;IACRC,aAAa;IACbC,SAAS,CAAC;EACZ;EACAC,aAAaC;EACbC,UAAU;IACRpB,OAAO;IACPU,OAAO;IACPL,OAAO;EACT;EACAgB,gBAAgBC,OAAKA;EACrBC,iBAAiB;EACjBC,iBAAiB;EACjBC,YAAY;EACZC,qBAAqB;AACvB;","names":["defaultBuildConfig","Object","freeze","buildType","format","target","sourceMap","copy","outDir","dts","only","distPath","tsconfigPath","abortOnError","jsx","input","platform","splitting","externals","minify","autoExternal","umdGlobals","sourceDir","alias","metafile","umdModuleName","name","define","asset","path","limit","publicPath","svgr","style","less","sass","postcss","
|
|
1
|
+
{"version":3,"mappings":";;;;+BAEaA;;aAAAA;;AAAN,MAAMA,qBAAqBC,OAAOC,OAAwB;EAC/DC,WAAW;EACXC,QAAQ;EACRC,QAAQ;EACRC,WAAW;EACXC,MAAM,CAAC;EACPC,QAAQ;EACRC,KAAKR,OAAOC,OAAO;IACjBQ,MAAM;IACNC,UAAU;IACVC,cAAc;IACdC,cAAc;EAChB;EACAC,KAAK;EACLC,OAAO;IAAC;;EACRC,UAAU;EACVC,WAAW;EACXC,WAAW;EACXC,QAAQ;EACRC,cAAc;EACdC,YAAY,CAAC;EACbC,WAAW;EACXC,OAAO,CAAC;EACRC,UAAU;EACVC,eAAeC,UAAQA;EACvBC,QAAQ,CAAC;EACTC,OAAO;IACLC,MAAM;IACNC,OAAO;IACPC,YAAY;IACZC,MAAM;EACR;EACAC,OAAO;IACLC,MAAM,CAAC;IACPC,MAAM,CAAC;IACPC,SAAS,CAAC;IACVC,aAAa,CAAC;IACdC,QAAQ;IACRC,aAAa;IACbC,SAAS,CAAC;EACZ;EACAC,aAAaC;EACbC,UAAU;IACRpB,OAAO;IACPU,OAAO;IACPL,OAAO;EACT;EACAgB,gBAAgBC,OAAKA;EACrBC,iBAAiB;EACjBC,iBAAiB;EACjBC,YAAY;EACZC,qBAAqB;AACvB;","names":["defaultBuildConfig","Object","freeze","buildType","format","target","sourceMap","copy","outDir","dts","only","distPath","tsconfigPath","abortOnError","jsx","input","platform","splitting","externals","minify","autoExternal","umdGlobals","sourceDir","alias","metafile","umdModuleName","name","define","asset","path","limit","publicPath","svgr","style","less","sass","postcss","tailwindcss","inject","autoModules","modules","sideEffects","undefined","redirect","esbuildOptions","c","externalHelpers","transformImport","sourceType","disableSwcTransform"],"sources":["../../src/constants/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/constants/build.ts"],"sourcesContent":["import type { BaseBuildConfig } from '../types';\n\nexport const defaultBuildConfig = Object.freeze<BaseBuildConfig>({\n buildType: 'bundle',\n format: 'cjs',\n target: 'es6',\n sourceMap: false,\n copy: {},\n outDir: './dist',\n dts: Object.freeze({\n only: false,\n distPath: './',\n tsconfigPath: './tsconfig.json',\n abortOnError: true,\n }),\n jsx: 'automatic',\n input: ['src/index.ts'],\n platform: 'node',\n splitting: false,\n externals: [],\n minify: false,\n autoExternal: true,\n umdGlobals: {},\n sourceDir: './src',\n alias: {},\n metafile: false,\n umdModuleName: name => name,\n define: {},\n asset: {\n path: 'assets',\n limit: 14336,\n publicPath: '',\n svgr: false,\n },\n style: {\n less: {},\n sass: {},\n postcss: {},\n tailwindcss: {},\n inject: false,\n autoModules: true,\n modules: {},\n },\n sideEffects: undefined,\n redirect: {\n alias: true,\n style: true,\n asset: true,\n },\n esbuildOptions: c => c,\n externalHelpers: false,\n transformImport: [],\n sourceType: 'module',\n disableSwcTransform: false,\n});\n"]}
|
|
@@ -35,7 +35,7 @@ export type BaseBuildConfig = Omit<Required<PartialBaseBuildConfig>, 'dts' | 'st
|
|
|
35
35
|
sideEffects: LibuildUserConfig['sideEffects'];
|
|
36
36
|
dts: false | DTSOptions;
|
|
37
37
|
style: Omit<Required<LibuildStyle>, 'cleanCss'> & {
|
|
38
|
-
|
|
38
|
+
tailwindcss: TailwindCSSConfig;
|
|
39
39
|
};
|
|
40
40
|
alias: Record<string, string>;
|
|
41
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;uBAiBc;","names":[],"sources":["../../../src/types/config/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/types/config/index.ts"],"sourcesContent":["import type {\n UserConfig as LibuildUserConfig,\n Asset as LibuildAsset,\n Style as LibuildStyle,\n} from '@modern-js/libuild';\nimport type { Options } from '@modern-js/libuild-plugin-svgr';\nimport type { ImportItem } from '@modern-js/libuild-plugin-swc';\nimport type { ToolsConfig as WebpackBuilderToolsConfig } from '@modern-js/builder-webpack-provider';\nimport { BuildInPreset, presetList } from '../../constants/buildPresets';\nimport type { CopyConfig } from '../copy';\nimport type {\n LessConfig,\n SassConfig,\n PostCSSConfig,\n TailwindCSSConfig,\n} from './style';\n\nexport * from './style';\n\nexport type BuildType = 'bundleless' | 'bundle';\n\nexport type Format = 'esm' | 'cjs' | 'umd' | 'iife';\n\nexport type Target =\n | 'es5'\n | 'es6'\n | 'es2015'\n | 'es2016'\n | 'es2017'\n | 'es2018'\n | 'es2019'\n | 'es2020'\n | 'es2021'\n | 'es2022'\n // The default target is esnext which means that by default, assume all of the latest JavaScript and CSS features are supported.\n | 'esnext';\n\nexport type Input = Required<LibuildUserConfig>['input'];\n\nexport type DTSOptions = {\n abortOnError: boolean;\n distPath: string;\n tsconfigPath: string;\n only: boolean;\n};\nexport type DTS = false | Partial<DTSOptions>;\n\nexport interface Asset {\n path?: LibuildAsset['outdir'];\n limit?: LibuildAsset['limit'];\n publicPath?: LibuildAsset['publicPath'];\n svgr?: boolean | Options;\n}\nexport type SourceMap = Required<LibuildUserConfig>['sourceMap'];\nexport type AutoExternal =\n | boolean\n | {\n dependencies?: boolean;\n peerDependencies?: boolean;\n };\nexport type JSX = 'automatic' | 'transform';\nexport type ExternalHelpers = boolean;\n\nexport type AliasOption =\n | Record<string, string>\n | ((aliases: Record<string, string>) => Record<string, string> | void);\n\nexport type BaseBuildConfig = Omit<\n Required<PartialBaseBuildConfig>,\n 'dts' | 'style' | 'alias' | 'sideEffects'\n> & {\n sideEffects: LibuildUserConfig['sideEffects'];\n dts: false | DTSOptions;\n style: Omit<Required<LibuildStyle>, 'cleanCss'> & {\n
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;;uBAiBc;","names":[],"sources":["../../../src/types/config/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/types/config/index.ts"],"sourcesContent":["import type {\n UserConfig as LibuildUserConfig,\n Asset as LibuildAsset,\n Style as LibuildStyle,\n} from '@modern-js/libuild';\nimport type { Options } from '@modern-js/libuild-plugin-svgr';\nimport type { ImportItem } from '@modern-js/libuild-plugin-swc';\nimport type { ToolsConfig as WebpackBuilderToolsConfig } from '@modern-js/builder-webpack-provider';\nimport { BuildInPreset, presetList } from '../../constants/buildPresets';\nimport type { CopyConfig } from '../copy';\nimport type {\n LessConfig,\n SassConfig,\n PostCSSConfig,\n TailwindCSSConfig,\n} from './style';\n\nexport * from './style';\n\nexport type BuildType = 'bundleless' | 'bundle';\n\nexport type Format = 'esm' | 'cjs' | 'umd' | 'iife';\n\nexport type Target =\n | 'es5'\n | 'es6'\n | 'es2015'\n | 'es2016'\n | 'es2017'\n | 'es2018'\n | 'es2019'\n | 'es2020'\n | 'es2021'\n | 'es2022'\n // The default target is esnext which means that by default, assume all of the latest JavaScript and CSS features are supported.\n | 'esnext';\n\nexport type Input = Required<LibuildUserConfig>['input'];\n\nexport type DTSOptions = {\n abortOnError: boolean;\n distPath: string;\n tsconfigPath: string;\n only: boolean;\n};\nexport type DTS = false | Partial<DTSOptions>;\n\nexport interface Asset {\n path?: LibuildAsset['outdir'];\n limit?: LibuildAsset['limit'];\n publicPath?: LibuildAsset['publicPath'];\n svgr?: boolean | Options;\n}\nexport type SourceMap = Required<LibuildUserConfig>['sourceMap'];\nexport type AutoExternal =\n | boolean\n | {\n dependencies?: boolean;\n peerDependencies?: boolean;\n };\nexport type JSX = 'automatic' | 'transform';\nexport type ExternalHelpers = boolean;\n\nexport type AliasOption =\n | Record<string, string>\n | ((aliases: Record<string, string>) => Record<string, string> | void);\n\nexport type BaseBuildConfig = Omit<\n Required<PartialBaseBuildConfig>,\n 'dts' | 'style' | 'alias' | 'sideEffects'\n> & {\n sideEffects: LibuildUserConfig['sideEffects'];\n dts: false | DTSOptions;\n style: Omit<Required<LibuildStyle>, 'cleanCss'> & {\n tailwindcss: TailwindCSSConfig;\n };\n alias: Record<string, string>;\n};\n\nexport type PartialBaseBuildConfig = {\n sourceType?: 'commonjs' | 'module';\n buildType?: 'bundleless' | 'bundle';\n format?: Format;\n target?: Target;\n dts?: DTS;\n sourceMap?: SourceMap;\n sourceDir?: string;\n copy?: CopyConfig;\n asset?: Asset;\n jsx?: JSX;\n outDir?: string;\n alias?: AliasOption;\n input?: Input;\n metafile?: boolean;\n platform?: LibuildUserConfig['platform'];\n splitting?: LibuildUserConfig['splitting'];\n minify?: LibuildUserConfig['minify'];\n externals?: LibuildUserConfig['external'];\n autoExternal?: AutoExternal;\n umdGlobals?: LibuildUserConfig['globals'];\n umdModuleName?: ((chunkName: string) => string) | string | undefined;\n define?: LibuildUserConfig['define'];\n style?: StyleConfig;\n redirect?: LibuildUserConfig['redirect'];\n sideEffects?: LibuildUserConfig['sideEffects'];\n esbuildOptions?: LibuildUserConfig['esbuildOptions'];\n // Related to swc-transform\n externalHelpers?: ExternalHelpers;\n transformImport?: ImportItem[];\n disableSwcTransform?: boolean;\n};\n\nexport type BuildConfig = BaseBuildConfig | BaseBuildConfig[];\nexport type PartialBuildConfig =\n | PartialBaseBuildConfig\n | PartialBaseBuildConfig[];\n\nexport type BuildPreset =\n | keyof typeof presetList\n | ((options: {\n preset: typeof BuildInPreset;\n extendPreset: (\n extendPresetName: keyof typeof BuildInPreset,\n extendBuildConfig: PartialBaseBuildConfig,\n ) => PartialBuildConfig;\n }) => PartialBuildConfig | Promise<PartialBuildConfig>);\n\nexport interface StyleConfig {\n less?: LessConfig;\n sass?: SassConfig;\n postcss?: PostCSSConfig;\n autoModules?: LibuildStyle['autoModules'];\n modules?: LibuildStyle['modules'];\n inject?: LibuildStyle['inject'];\n /**\n * The configuration of `tools.tailwindcss` is provided by `tailwindcss` plugin.\n * Please use `yarn new` or `pnpm new` to enable the corresponding capability.\n * @requires `tailwindcss` plugin\n */\n tailwindcss?: TailwindCSSConfig;\n}\n\nexport interface StorybookBuildConfig {\n webpack?: WebpackBuilderToolsConfig['webpack'];\n webpackChain?: WebpackBuilderToolsConfig['webpackChain'];\n}\nexport interface Dev {\n storybook?: StorybookBuildConfig;\n}\n\nexport interface RuntimeUserConfig {\n [name: string]: any;\n}\n\nexport interface ModuleExtraConfig {\n designSystem?: Record<string, any>;\n\n buildConfig?: PartialBuildConfig;\n\n buildPreset?: BuildPreset;\n\n dev?: Dev;\n\n runtime?: RuntimeUserConfig;\n}\n"]}
|
package/dist/utils/config.js
CHANGED
|
@@ -36,7 +36,7 @@ const validBuildTypeAndFormat = (config) => {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
const mergeDefaultBaseConfig = async (pConfig, context) => {
|
|
39
|
-
var _pConfig_style, _pConfig_style1, _pConfig_style2;
|
|
39
|
+
var _pConfig_style, _pConfig_style1, _pConfig_style2, _pConfig_style3;
|
|
40
40
|
const { defaultBuildConfig: defaultConfig } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("../constants/build")));
|
|
41
41
|
const { cloneDeep } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("@modern-js/utils/lodash")));
|
|
42
42
|
const { applyOptionsChain, ensureAbsolutePath, slash } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("@modern-js/utils")));
|
|
@@ -78,7 +78,7 @@ const mergeDefaultBaseConfig = async (pConfig, context) => {
|
|
|
78
78
|
};
|
|
79
79
|
var _pConfig_esbuildOptions;
|
|
80
80
|
const esbuildOptions = (_pConfig_esbuildOptions = pConfig.esbuildOptions) !== null && _pConfig_esbuildOptions !== void 0 ? _pConfig_esbuildOptions : defaultConfig.esbuildOptions;
|
|
81
|
-
var _pConfig_format, _pConfig_target, _pConfig_sourceMap, _pConfig_copy, _pConfig_outDir, _pConfig_jsx, _pConfig_input, _pConfig_platform, _pConfig_splitting, _pConfig_minify, _pConfig_autoExternal, _pConfig_umdModuleName, _pConfig_sideEffects, _pConfig_externals, _pConfig_style_inject, _pConfig_style_modules, _pConfig_style_autoModules, _pConfig_externalHelpers, _pConfig_transformImport, _pConfig_sourceType, _pConfig_disableSwcTransform;
|
|
81
|
+
var _pConfig_format, _pConfig_target, _pConfig_sourceMap, _pConfig_copy, _pConfig_outDir, _pConfig_jsx, _pConfig_input, _pConfig_platform, _pConfig_splitting, _pConfig_minify, _pConfig_autoExternal, _pConfig_umdModuleName, _pConfig_sideEffects, _pConfig_externals, _pConfig_style_inject, _pConfig_style_modules, _pConfig_style_autoModules, _pConfig_style_tailwindcss, _pConfig_externalHelpers, _pConfig_transformImport, _pConfig_sourceType, _pConfig_disableSwcTransform;
|
|
82
82
|
return {
|
|
83
83
|
asset: {
|
|
84
84
|
...defaultConfig.asset,
|
|
@@ -113,7 +113,7 @@ const mergeDefaultBaseConfig = async (pConfig, context) => {
|
|
|
113
113
|
inject: (_pConfig_style_inject = (_pConfig_style = pConfig.style) === null || _pConfig_style === void 0 ? void 0 : _pConfig_style.inject) !== null && _pConfig_style_inject !== void 0 ? _pConfig_style_inject : defaultConfig.style.inject,
|
|
114
114
|
modules: (_pConfig_style_modules = (_pConfig_style1 = pConfig.style) === null || _pConfig_style1 === void 0 ? void 0 : _pConfig_style1.modules) !== null && _pConfig_style_modules !== void 0 ? _pConfig_style_modules : defaultConfig.style.modules,
|
|
115
115
|
autoModules: (_pConfig_style_autoModules = (_pConfig_style2 = pConfig.style) === null || _pConfig_style2 === void 0 ? void 0 : _pConfig_style2.autoModules) !== null && _pConfig_style_autoModules !== void 0 ? _pConfig_style_autoModules : defaultConfig.style.autoModules,
|
|
116
|
-
|
|
116
|
+
tailwindcss: (_pConfig_style_tailwindcss = (_pConfig_style3 = pConfig.style) === null || _pConfig_style3 === void 0 ? void 0 : _pConfig_style3.tailwindcss) !== null && _pConfig_style_tailwindcss !== void 0 ? _pConfig_style_tailwindcss : defaultConfig.style.tailwindcss
|
|
117
117
|
},
|
|
118
118
|
redirect: {
|
|
119
119
|
...defaultConfig.redirect,
|
package/dist/utils/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EASaA,yBAAuB,MAAvBA;EAUAC,yBAAuB,MAAvBA;EAWAC,wBAAsB,MAAtBA;
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EASaA,yBAAuB,MAAvBA;EAUAC,yBAAuB,MAAvBA;EAWAC,wBAAsB,MAAtBA;EAyGAC,cAAY,MAAZA;EAsBAC,oBAAkB,MAAlBA;;;AApJN,MAAMJ,0BAA0B,CAACK,WAA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C1BoE,SACAC,eACG;AACH,QAAM,EAAEvD,WAAWwD,aAAaC,SAAQ,IAAK,MAAM,iFACjD;AAGF,MAAID,YAAYF,UAAU;AACxB,WAAOtD,UAAUuD;EACnB;AAEA,MAAIE,SAASH,UAAU;AACrB,WAAO;MACL,GAAGC;MACH,GAAGD;IACL;EACF;AAEA,SAAOA;AACT;AAEO,MAAMnE,qBAAqB,CAACC,WAEKsE,QAAQtE,OAAOuE,MAAM;","names":["validPartialBuildConfig","validBuildTypeAndFormat","mergeDefaultBaseConfig","getDtsConfig","isLegacyUserConfig","config","Array","isArray","c","buildType","includes","format","Error","pConfig","context","defaultBuildConfig","defaultConfig","cloneDeep","applyOptionsChain","ensureAbsolutePath","slash","getDefaultIndexEntry","getStyleConfig","defaultAlias","srcDirectory","mergedAlias","alias","Object","keys","reduce","prev","name","formattedValue","value","startsWith","appDirectory","styleConfig","sourceDir","metafile","input","userDefine","define","memo","JSON","stringify","esbuildOptions","asset","target","sourceMap","copy","outDir","dts","jsx","platform","splitting","minify","autoExternal","umdGlobals","umdModuleName","sideEffects","externals","style","inject","modules","autoModules","tailwindcss","redirect","externalHelpers","transformImport","sourceType","disableSwcTransform","userDTS","defaultDTS","isUndefined","isObject","Boolean","legacy"],"sources":["../../src/utils/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/utils/config.ts"],"sourcesContent":["import { ModuleContext } from '../types';\nimport type {\n BaseBuildConfig,\n PartialBuildConfig,\n PartialBaseBuildConfig,\n DTSOptions,\n ModuleLegacyUserConfig,\n} from '../types';\n\nexport const validPartialBuildConfig = (config: PartialBuildConfig) => {\n if (Array.isArray(config)) {\n for (const c of config) {\n validBuildTypeAndFormat(c);\n }\n } else {\n validBuildTypeAndFormat(config);\n }\n};\n\nexport const validBuildTypeAndFormat = (config: PartialBaseBuildConfig) => {\n if (\n config.buildType === 'bundleless' &&\n ['iife', 'umd'].includes(config.format ?? '')\n ) {\n throw new Error(\n `when buildType is bundleless, the format must be equal to one of the allowed values: (cjs, esm)`,\n );\n }\n};\n\nexport const mergeDefaultBaseConfig = async (\n pConfig: PartialBaseBuildConfig,\n context: ModuleContext,\n): Promise<BaseBuildConfig> => {\n const { defaultBuildConfig: defaultConfig } = await import(\n '../constants/build'\n );\n const { cloneDeep } = await import('@modern-js/utils/lodash');\n const { applyOptionsChain, ensureAbsolutePath, slash } = await import(\n '@modern-js/utils'\n );\n const { getDefaultIndexEntry } = await import('./input');\n const { getStyleConfig } = await import('./style');\n const defaultAlias = {\n '@': context.srcDirectory,\n };\n const mergedAlias = applyOptionsChain(defaultAlias, pConfig.alias);\n\n /**\n * Format alias value:\n * - Relative paths need to be turned into absolute paths.\n * - Absolute paths or a package name are not processed.\n */\n const alias = Object.keys(mergedAlias).reduce<Record<string, string>>(\n (prev, name) => {\n const formattedValue = (value: string) => {\n if (typeof value === 'string' && value.startsWith('.')) {\n return slash(ensureAbsolutePath(context.appDirectory, value));\n }\n return value;\n };\n const value = formattedValue(mergedAlias[name]);\n\n prev[name] = value;\n return prev;\n },\n {},\n );\n\n const styleConfig = await getStyleConfig(pConfig);\n const buildType = pConfig.buildType ?? defaultConfig.buildType;\n const sourceDir = pConfig.sourceDir ?? defaultConfig.sourceDir;\n const metafile = pConfig.metafile ?? defaultConfig.metafile;\n const input =\n buildType === 'bundle' ? await getDefaultIndexEntry(context) : [sourceDir];\n const userDefine = pConfig.define ?? {};\n const define = {\n ...defaultConfig.define,\n ...Object.keys(userDefine).reduce<Record<string, string>>((memo, name) => {\n memo[name] = JSON.stringify(userDefine[name]!);\n return memo;\n }, {}),\n };\n const esbuildOptions = pConfig.esbuildOptions ?? defaultConfig.esbuildOptions;\n return {\n asset: {\n ...defaultConfig.asset,\n ...pConfig.asset,\n },\n buildType,\n format: pConfig.format ?? defaultConfig.format,\n target: pConfig.target ?? defaultConfig.target,\n sourceMap: pConfig.sourceMap ?? defaultConfig.sourceMap,\n copy: pConfig.copy ?? cloneDeep(defaultConfig.copy),\n outDir: pConfig.outDir ?? defaultConfig.outDir,\n dts: await getDtsConfig(pConfig.dts, defaultConfig.dts as DTSOptions),\n jsx: pConfig.jsx ?? defaultConfig.jsx,\n input: pConfig.input ?? cloneDeep(input),\n platform: pConfig.platform ?? defaultConfig.platform,\n splitting: pConfig.splitting ?? defaultConfig.splitting,\n minify: pConfig.minify ?? defaultConfig.minify,\n autoExternal: pConfig.autoExternal ?? defaultConfig.autoExternal,\n umdGlobals: {\n ...defaultConfig.umdGlobals,\n ...pConfig.umdGlobals,\n },\n umdModuleName: pConfig.umdModuleName ?? defaultConfig.umdModuleName,\n sideEffects: pConfig.sideEffects ?? defaultConfig.sideEffects,\n externals: pConfig.externals ?? defaultConfig.externals,\n sourceDir,\n alias,\n define,\n metafile,\n style: {\n ...styleConfig,\n inject: pConfig.style?.inject ?? defaultConfig.style.inject,\n modules: pConfig.style?.modules ?? defaultConfig.style.modules,\n autoModules:\n pConfig.style?.autoModules ?? defaultConfig.style.autoModules,\n tailwindcss:\n pConfig.style?.tailwindcss ?? defaultConfig.style.tailwindcss,\n },\n redirect: {\n ...defaultConfig.redirect,\n ...pConfig.redirect,\n },\n esbuildOptions,\n externalHelpers: pConfig.externalHelpers ?? defaultConfig.externalHelpers,\n transformImport: pConfig.transformImport ?? defaultConfig.transformImport,\n sourceType: pConfig.sourceType ?? defaultConfig.sourceType,\n disableSwcTransform:\n pConfig.disableSwcTransform ?? defaultConfig.disableSwcTransform,\n };\n};\n\nexport const getDtsConfig = async (\n userDTS: PartialBaseBuildConfig['dts'],\n defaultDTS: Required<DTSOptions>,\n) => {\n const { cloneDeep, isUndefined, isObject } = await import(\n '@modern-js/utils/lodash'\n );\n\n if (isUndefined(userDTS)) {\n return cloneDeep(defaultDTS);\n }\n\n if (isObject(userDTS)) {\n return {\n ...defaultDTS,\n ...userDTS,\n };\n }\n\n return userDTS;\n};\n\nexport const isLegacyUserConfig = (config: {\n legacy?: boolean;\n}): config is ModuleLegacyUserConfig => Boolean(config.legacy);\n"]}
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"module-tools",
|
|
16
16
|
"lib-tools"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.18.1",
|
|
19
19
|
"bin": {
|
|
20
20
|
"modern": "./bin/modern.js",
|
|
21
21
|
"modern-module": "./bin/modern.js"
|
|
@@ -40,19 +40,19 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@modern-js/libuild": "
|
|
44
|
-
"@modern-js/libuild-plugin-svgr": "
|
|
45
|
-
"@modern-js/libuild-plugin-swc": "
|
|
43
|
+
"@modern-js/libuild": "0.12.2",
|
|
44
|
+
"@modern-js/libuild-plugin-svgr": "0.12.2",
|
|
45
|
+
"@modern-js/libuild-plugin-swc": "0.12.2",
|
|
46
46
|
"postcss": "8.4.6",
|
|
47
47
|
"@swc/helpers": "0.5.0",
|
|
48
|
-
"@modern-js/core": "2.
|
|
49
|
-
"@modern-js/new-action": "2.
|
|
50
|
-
"@modern-js/plugin": "2.
|
|
51
|
-
"@modern-js/plugin-changeset": "2.
|
|
52
|
-
"@modern-js/plugin-i18n": "2.
|
|
53
|
-
"@modern-js/plugin-lint": "2.
|
|
54
|
-
"@modern-js/upgrade": "2.
|
|
55
|
-
"@modern-js/utils": "2.
|
|
48
|
+
"@modern-js/core": "2.18.1",
|
|
49
|
+
"@modern-js/new-action": "2.18.1",
|
|
50
|
+
"@modern-js/plugin": "2.18.1",
|
|
51
|
+
"@modern-js/plugin-changeset": "2.18.1",
|
|
52
|
+
"@modern-js/plugin-i18n": "2.18.1",
|
|
53
|
+
"@modern-js/plugin-lint": "2.18.1",
|
|
54
|
+
"@modern-js/upgrade": "2.18.1",
|
|
55
|
+
"@modern-js/utils": "2.18.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/fs-extra": "9.0.13",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"postcss-alias": "2.0.0",
|
|
66
66
|
"react": "17",
|
|
67
67
|
"typescript": "^4",
|
|
68
|
-
"@modern-js/builder-webpack-provider": "2.
|
|
69
|
-
"@modern-js/self": "npm:@modern-js/module-tools@2.
|
|
70
|
-
"@scripts/
|
|
71
|
-
"@scripts/
|
|
68
|
+
"@modern-js/builder-webpack-provider": "2.18.1",
|
|
69
|
+
"@modern-js/self": "npm:@modern-js/module-tools@2.18.1",
|
|
70
|
+
"@scripts/jest-config": "2.18.1",
|
|
71
|
+
"@scripts/build": "2.18.1"
|
|
72
72
|
},
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"registry": "https://registry.npmjs.org/",
|