babel / babel/babel-loader

can't disable cache through api.cache.never()

Open
#752 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.8k
Forks
456
Avg merge
9h 19m
Merged PRs (30d)
2

Description

**Webpack Version:**
4.28.2

**Babel Core Version**:
7.2.2

**Babel Loader Version**:
80.4

**Please tell us about your environment:**
OSX 10.14

**Current behavior:**

I tried some ways to disable the cache, and here is what I got

`api.cache.using` in `babel.config.js`
---

```js
// babel.config.js
module.exports = api => {
api.cache.using(() => process.env.__CUSTOM_ENV__)
// return config based on __CUSTOM_ENV__
...
}
```

Doesn't work, I have changed the `process.env.__CUSTOM_ENV__` value before each webpack compile, but the config function only be called once.

`api.cache.never` in `babel.config.js`
---

![image](https://user-images.githubusercontent.com/4456380/50467956-84fce000-09e0-11e9-9d05-f6aec0970fa5.png)

`cacheIdentifier` in `babel-loder` options
---

Doesn't work, `cacheIdentifier` changed, config function only be called once.

**Expected/desired behavior:**

Should recall the babel config function, get the right config, output the right bundle result.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.