Skip to content

Conversation

LinusBorg
Copy link
Member

@LinusBorg LinusBorg commented Mar 13, 2019

a2bc927#diff-04612bf191a2c1a06ac248910d9e9415R162 attempted to fix a problem with cache invalidation when javascript config files (like babel.config.js) change their content i.e. depending on an env variable.

The fix was:

          if (absolutePath.endsWith('.js')) {
            // should evaluate config scripts to reflect environment variable changes
            try {
              return JSON.stringify(require(absolutePath))
            } catch (e) {
              return fs.readFileSync(absolutePath, 'utf-8')
            }
         }

However we missed to add an else branch to keep including non-js config files (like .browserslistrc) in the generation of the cache key.

This PR adds that else { branch

close #3631

@LinusBorg LinusBorg marked this pull request as ready for review March 14, 2019 08:14
@haoqunjiang haoqunjiang merged commit adac48d into dev Mar 27, 2019
@LinusBorg LinusBorg deleted the LinusBorg-patch-3631 branch May 3, 2019 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changing .browserslistrc file content doesn't invalidate cache
2 participants