Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'named capture groups' babel plugin #690

Merged
merged 2 commits into from Feb 17, 2021
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Prev

run babel plugin over adblocker-extended-selectors

  • Loading branch information
christophertino committed Feb 17, 2021
commit 2c453353f795355169843823596c3a150eff7692
@@ -16,7 +16,6 @@ module.exports = function(api) {
let plugins = [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-transform-named-capturing-groups-regex',
];

switch (api.env()) {
@@ -27,6 +26,11 @@ module.exports = function(api) {
// Don't transpile the './src' dir
presets = [];
break;
case 'cliqz':
// Set plugins to run over @cliqz modules
presets = [];
plugins = ['@babel/plugin-transform-named-capturing-groups-regex'];
break;
case 'test':
// Calling Jest from package.json with `BABEL_ENV=test` set
plugins.push('@babel/plugin-transform-modules-commonjs');
@@ -143,6 +143,17 @@ module.exports = {
},
'eslint-loader'
]
}, {
test: /\.js$/,
include: [path.resolve(__dirname, 'node_modules/@cliqz/adblocker-extended-selectors')],
use: [
{
loader: 'babel-loader',
options: {
envName: 'cliqz',
}
}
]
}, {
test: /\.scss$/,
resolve: {
ProTip! Use n and p to navigate between commits in a pull request.