Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ export default {

指定产物的输出目录及输出文件名,输出目录的默认值为 `dist/umd`,输出文件名在单 `entry` 时默认以 NPM 包名命名、多 `entry` 时默认与源码文件同名。

#### transformRuntime

- 类型:`{ absoluteRuntime?: string }`
- 默认值:`{}`

配置 transform-runtime 插件的部分功能。

#### externals

- 类型:`Record<string, string>`
Expand Down
2 changes: 1 addition & 1 deletion src/builder/bundle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async function bundle(opts: IBundleOpts): Promise<void | IBundleWatcher> {
opts.cwd,
),
presetTypeScript: {},
pluginTransformRuntime: {},
pluginTransformRuntime: config.transformRuntime || {},
pluginLockCoreJS: {},
pluginDynamicImportNode: false,
},
Expand Down
3 changes: 3 additions & 0 deletions src/features/configPlugins/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ export function getSchemas(): Record<string, (Joi: Root) => any> {
Joi.array(),
),
generateUnminified: Joi.boolean().optional(),
transformRuntime: Joi.object({
absoluteRuntime: Joi.string().optional(),
}).optional(),
chainWebpack: Joi.function().optional(),
extractCSS: Joi.boolean().optional(),
name: Joi.string().optional(),
Expand Down
10 changes: 10 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ export interface IFatherBaseConfig {
*/
extraBabelPlugins?: IBundlerWebpackConfig['extraBabelPlugins'];

/**
* configure transform runtime
*/
transformRuntime?: {
/**
* absolute dir path which contains @babel/runtime
*/
absoluteRuntime?: string;
};

/**
* output sourcemap
*/
Expand Down
Loading