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: genCacheConfig return different result because linebreak #3372

Merged
merged 1 commit into from
Jan 28, 2019

Conversation

WilsonLiu95
Copy link
Contributor

when I build in different plat generate different hash because Linebreak is different.

@haoqunjiang
Copy link
Member

Do you have a reproduction? I don't think cache config will affect the content hash

@WilsonLiu95
Copy link
Contributor Author

WilsonLiu95 commented Jan 26, 2019

Do you have a reproduction? I don't think cache config will affect the content hash

cacheIdentifier will be insert to file in comments. so affect the content hash.

hash-sum will transform function to string to generate hash. so the linebreak will affect

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"64bd234e-vue-loader-template"}

@haoqunjiang
Copy link
Member

But comments are removed in production, and in development we don't add hashes.

@WilsonLiu95
Copy link
Contributor Author

This is the same to vuejs/vue-loader#1477.
webpack generate hash before remove comments

@haoqunjiang
Copy link
Member

Got it. Thanks for pointing out.

One last thing before merging it: could you please run npx eslint --fix packages/@vue/cli-service/lib/PluginAPI.js in the project root? There're several style issues in the code.

@WilsonLiu95
Copy link
Contributor Author

😄Ok.Wait for tommorow morning~
I am not in office now.

I think webpack should generate hash by the last file to confirm hash last more time.

Users can get assets from cache.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@WilsonLiu95
Copy link
Contributor Author

Got it. Thanks for pointing out.

One last thing before merging it: could you please run npx eslint --fix packages/@vue/cli-service/lib/PluginAPI.js in the project root? There're several style issues in the code.

I have run eslint~

@haoqunjiang haoqunjiang merged commit ab13dfe into vuejs:dev Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants