mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-05-17 04:39:40 +03:00
revamp babel config
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
"./playwright": "./src/playwright.js",
|
||||
"./playwright.coverage": "./src/playwright.coverage.js",
|
||||
"./jest": "./src/jest.js",
|
||||
"./babel": "./src/babel.js",
|
||||
"./jest-babel": "./src/jest.babel.js",
|
||||
"./full-coverage": "./src/full-coverage.js"
|
||||
},
|
||||
"version": "0.0.0"
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
module.exports = function (api) {
|
||||
api.cache.using(() => process.env.NODE_ENV);
|
||||
const isJest = api.caller((caller) => !!(caller && caller.name === 'babel-jest'));
|
||||
|
||||
if (isJest) {
|
||||
return {
|
||||
plugins: [
|
||||
'@babel/plugin-transform-modules-commonjs',
|
||||
['@babel/plugin-proposal-private-methods', { loose: false }],
|
||||
],
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
targets: {
|
||||
node: 'current',
|
||||
},
|
||||
},
|
||||
],
|
||||
'@babel/preset-typescript',
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
return {};
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@babel/preset-env',
|
||||
'@babel/preset-typescript',
|
||||
[
|
||||
'@babel/preset-react',
|
||||
{
|
||||
runtime: 'automatic',
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
@@ -42,7 +42,6 @@ module.exports = {
|
||||
},
|
||||
testPathIgnorePatterns: ['\\\\node_modules\\\\'],
|
||||
setupFilesAfterEnv: [path.resolve(__dirname, './jest.setup.js')],
|
||||
...resolve.paths.jest,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user