vant/babel.config.js
2019-02-07 10:43:36 +08:00

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'
]
};
};