-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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
Allow BABEL_DISABLE_CACHE to override cacheDirectory
in webpack.js
#3164
Comments
cacheDirectory
in webpack.js
Workaround
module.exports = {
webpack: (config, {dev}) => {
disableCacheDirectory(config)
return config
}
}
function disableCacheDirectory(config) {
config.module.rules
.filter(({loader}) => loader === 'babel-loader')
.map(l => (l.options.cacheDirectory = false))
} |
@vjpr you are THE man. |
@vjpr's workaround worked for me, but I had to |
@timneutkens https://babeljs.io/docs/usage/babel-register/#environment-variables Seems that this is only for |
I tried the workaround with function disableCacheDirectory(config) {
config.module.rules
.filter(({ use }) => use && use.loader === 'babel-loader')
.map(l => (l.use.options.cacheDirectory = false))
} |
Feel free to create a community supported plugin to do ^ 👍We're not planning to turn it into an environment variable. |
Can anyone confirm that this workaround still works in Update: config.module.rules = config.module.rules.map(rule => {
if (rule.use.loader && rule.use.loader === 'next-babel-loader') {
rule.use.options.cacheDirectory = false;
}
return rule;
});
return config; |
Currently, you can clear the cache in
node_modules/.cache
. But if you are developing, or changing presets, you might want to force cache clear using standard babel env var.Context
Trying to support pnpm #2855
Your Environment
The text was updated successfully, but these errors were encountered: