mirror of https://github.com/dessant/buster
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
673 B
JavaScript
35 lines
673 B
JavaScript
const path = require('node:path');
|
|
|
|
const corejsVersion = require(path.join(
|
|
path.dirname(require.resolve('core-js')),
|
|
'package.json'
|
|
)).version;
|
|
|
|
module.exports = function (api) {
|
|
const presets = [
|
|
[
|
|
'@babel/env',
|
|
{
|
|
modules: false,
|
|
bugfixes: true,
|
|
useBuiltIns: 'usage',
|
|
corejs: {version: corejsVersion}
|
|
}
|
|
]
|
|
];
|
|
|
|
const plugins = [];
|
|
|
|
const ignore = [
|
|
new RegExp(`node_modules\\${path.sep}(?!(vueton|wesa)\\${path.sep}).*`)
|
|
];
|
|
|
|
const parserOpts = {plugins: ['importAssertions']};
|
|
|
|
if (api.env('production')) {
|
|
plugins.push('lodash');
|
|
}
|
|
|
|
return {presets, plugins, ignore, parserOpts};
|
|
};
|