vant/babel.config.js
2018-08-28 21:24:55 +08:00

31 lines
565 B
JavaScript

module.exports = function(api) {
const { BABEL_MODULE } = process.env;
const useESModules = BABEL_MODULE !== 'commonjs';
api.cache(false);
return {
presets: [
[
'@babel/preset-env',
{
loose: true,
modules: BABEL_MODULE || false
}
]
],
plugins: [
[
'@babel/plugin-transform-runtime',
{
corejs: false,
helpers: true,
regenerator: false,
useESModules
}
],
'@babel/plugin-syntax-dynamic-import'
]
};
};