mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-20 00:30:37 +03:00
improve codebase
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
module.exports = function (api) {
|
||||
api.cache.using(() => process.env.NODE_ENV);
|
||||
const isRollup = api.caller((caller) => !!(caller && caller.name === 'babel-rollup-build'));
|
||||
const isJest = api.caller((caller) => !!(caller && caller.name === 'babel-jest'));
|
||||
|
||||
if (api.env('build')) {
|
||||
if (isRollup) {
|
||||
return {
|
||||
plugins: ['@babel/plugin-transform-runtime', '@babel/plugin-proposal-class-properties'],
|
||||
};
|
||||
}
|
||||
|
||||
if (api.env('test')) {
|
||||
if (isJest) {
|
||||
return {
|
||||
plugins: ['@babel/plugin-transform-modules-commonjs'],
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
useBuiltIns: 'usage',
|
||||
corejs: { version: 3, proposals: true },
|
||||
targets: {
|
||||
node: 'current',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user