mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-05 05:42:44 +08:00
39 lines
797 B
JavaScript
39 lines
797 B
JavaScript
module.exports = function (api) {
|
|
const { BABEL_MODULE, NODE_ENV } = process.env;
|
|
const useESModules = BABEL_MODULE !== 'commonjs' && NODE_ENV !== 'test';
|
|
|
|
api && api.cache(false);
|
|
|
|
return {
|
|
presets: [
|
|
[
|
|
'@babel/preset-env',
|
|
{
|
|
loose: true,
|
|
modules: useESModules ? false : 'commonjs'
|
|
}
|
|
],
|
|
[
|
|
'@vue/babel-preset-jsx',
|
|
{
|
|
functional: false
|
|
}
|
|
],
|
|
'@babel/preset-typescript'
|
|
],
|
|
plugins: [
|
|
[
|
|
'@babel/plugin-transform-runtime',
|
|
{
|
|
corejs: false,
|
|
helpers: true,
|
|
regenerator: false,
|
|
useESModules
|
|
}
|
|
],
|
|
'@babel/plugin-syntax-dynamic-import',
|
|
'@babel/plugin-transform-object-assign'
|
|
]
|
|
};
|
|
};
|