Chatwoot/babel.config.js

37 lines
848 B
JavaScript
Raw Permalink Normal View History

2019-08-21 16:07:06 +00:00
/* eslint-disable global-require */
const plugins = () => [
require('babel-plugin-macros'),
[
require('@babel/plugin-proposal-class-properties').default,
{
loose: true,
},
],
[require('babel-plugin-transform-vue-jsx')],
];
2019-08-21 16:07:06 +00:00
module.exports = api => {
const validEnv = ['development', 'test', 'production'];
const currentEnv = api.env();
if (!validEnv.includes(currentEnv)) {
throw new Error(
2019-08-21 16:07:06 +00:00
`${'Please specify a valid `NODE_ENV` or ' +
'`BABEL_ENV` environment variables. Valid values are "development", ' +
2019-08-21 16:07:06 +00:00
'"test", and "production". Instead, received: '}${JSON.stringify(
currentEnv
)}.`
);
}
return {
presets: [
[
require('@babel/preset-env').default,
{ useBuiltIns: 'usage', corejs: 3 },
],
],
plugins: plugins(),
2019-08-21 16:07:06 +00:00
};
};