Created
July 30, 2020 03:50
-
-
Save sotnikov-link/2bf2c25478207f61330bca050e509918 to your computer and use it in GitHub Desktop.
Transpile some node modules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @see https://github.com/babel/babel-loader/issues/171#issuecomment-464721341 | |
*/ | |
const transpileDependencies = ['regexpu-core']; | |
const include = new RegExp( | |
`node_modules/(${transpileDependencies.join('|')})/.*` | |
); | |
config.module.rules.push({ | |
test: /\.js$/, | |
include, | |
use: [ | |
{ | |
loader: 'babel-loader', | |
options: { | |
presets: [ | |
[ | |
'@babel/preset-env', | |
// { modules: 'commonjs' } | |
], | |
], | |
}, | |
}, | |
], | |
}); | |
console.dir(config.module.rules, { depth: null }); | |
console.log({ include }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment