vant/babel.config.js
2019-01-05 15:11:04 +08:00

33 lines
692 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'
}
]
],
plugins: [
[
'@babel/plugin-transform-runtime',
{
corejs: false,
helpers: true,
regenerator: false,
useESModules
}
],
'transform-vue-jsx',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-transform-object-assign'
]
};
};