babel-loader
babel-loader copied to clipboard
Changes to .browserslistrc does not invalidate cache
I'm submitting a bug report
There seems to have been an existing issue #587 related to changes in .babelrc. It looks like it was fixed for .babelrc, but with @babel/[email protected], changes to .browserslistrc can also affect what babel should be outputting.
Webpack Version: 4.20.2
Babel Core Version: 7.1.0
Babel Loader Version: 8.0.2
Please tell us about your environment: OSX 10.13.6
Current behavior:
When using cacheDirectory: true, the cache does not get invalidated between changes to .browserslistrc contents. Disabling the cache works as expected and changes to .browserslistrc are reflected in the generated bundle.
Expected/desired behavior:
When using cacheDirectory: true, the cache should be invalidated between changes to the .browserslistrc file
- If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem along with a gist/jsbin of your webpack configuration. Configuration
{
loader: 'babel-loader',
options: {
cacheDirectory: true,
presets: [
[
"@babel/preset-env",
{
useBuiltIns: "entry",
modules: false,
}
],
"@babel/react",
"@babel/typescript",
],
plugins: [
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread",
"react-hot-loader/babel",
],
}
}
We could potentially special-case this in babel-loader, but really this is probably related to https://github.com/babel/babel/issues/8497. Happy to leave this open as a tracking issue.
That sounds great! I wasn't aware of that effort, but seems like it definitely would be the better solution
FYI the PR related to the bug https://github.com/babel/babel/issues/8497 mentioned by @loganfsmyth is having some activity these days: https://github.com/babel/babel/pull/11741. 🤞
Edit: planned for babel 7.17.
Is this issue still valid?
Is this still an issue with https://github.com/babel/babel/pull/14065 ?