mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
fix: bable plugin | presets 配置不起作用
This commit is contained in:
parent
7460db344f
commit
4b019a0688
@ -2,9 +2,10 @@ import {
|
||||
winPath
|
||||
} from '@umijs/utils';
|
||||
|
||||
function getBabelOpts({
|
||||
function getBableOpts({
|
||||
cwd,
|
||||
targets,
|
||||
config,
|
||||
presetOpts
|
||||
}) {
|
||||
const presets = [
|
||||
@ -19,7 +20,8 @@ function getBabelOpts({
|
||||
},
|
||||
modules: false
|
||||
}
|
||||
]
|
||||
],
|
||||
...(config.extraBabelPresets || [])
|
||||
];
|
||||
const plugins = [
|
||||
require('@babel/plugin-proposal-export-default-from').default,
|
||||
@ -45,7 +47,8 @@ function getBabelOpts({
|
||||
importOpts.libraryName
|
||||
])
|
||||
: []),
|
||||
require.resolve('@vue/babel-plugin-jsx')
|
||||
require.resolve('@vue/babel-plugin-jsx'),
|
||||
...(config.extraBabelPresets || [])
|
||||
];
|
||||
return {
|
||||
babelrc: false,
|
||||
@ -62,6 +65,7 @@ function getBabelOpts({
|
||||
|
||||
export default async ({
|
||||
cwd,
|
||||
config,
|
||||
modifyBabelOpts,
|
||||
modifyBabelPresetOpts,
|
||||
targets
|
||||
@ -72,8 +76,9 @@ export default async ({
|
||||
if (modifyBabelPresetOpts) {
|
||||
presetOpts = await modifyBabelPresetOpts(presetOpts);
|
||||
}
|
||||
let babelOpts = getBabelOpts({
|
||||
let babelOpts = getBableOpts({
|
||||
cwd,
|
||||
config,
|
||||
presetOpts,
|
||||
targets
|
||||
});
|
||||
|
@ -157,6 +157,7 @@ export default async function getConfig({
|
||||
const { targets, browserslist } = getTargetsAndBrowsersList({ config });
|
||||
const babelOpts = await getBableOpts({
|
||||
cwd,
|
||||
config,
|
||||
modifyBabelOpts,
|
||||
modifyBabelPresetOpts,
|
||||
targets
|
||||
|
Loading…
x
Reference in New Issue
Block a user