Skip to content
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

fix: properly load non-js config files in genCacheConfig #3632

Merged
merged 1 commit into from
Mar 27, 2019

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

Verified

This commit was signed with the committer’s verified signature.
joshka Josh McKinney
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