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

Change [chunkhash] to [hash]-[id] #199

Closed
troyt-42 opened this issue Nov 1, 2016 · 5 comments
Closed

Change [chunkhash] to [hash]-[id] #199

troyt-42 opened this issue Nov 1, 2016 · 5 comments
Assignees

Comments

@troyt-42
Copy link

troyt-42 commented Nov 1, 2016

Using [chunkhash] causes errores when npm run dev:

ERROR in chunk app [entry]
[name].[chunkhash].js
Cannot use [chunkhash] for chunk in '[name].[chunkhash].js' (use [hash] instead)

ERROR in chunk vendor [entry]
[name].[chunkhash].js
Cannot use [chunkhash] for chunk in '[name].[chunkhash].js' (use [hash] instead)

and I think [hash]-[id] has the same effect of [chunkhash].

@SethDavenport
Copy link
Contributor

@smithad15 thoughts?

@smithad15
Copy link
Contributor

[hash]-[id] does not give the same effect since [hash] is the hash of the compilation while [chunkhash] is the hash of that specific chunk file.

Upon investigation it looks like it is a problem with webpack-dev-server --hot. It is suggested to only do hashes in production builds, not dev builds. Probably a good idea since hash calculations in development don't particularly matter. See this issue: webpack/webpack-dev-server#377

@SethDavenport
Copy link
Contributor

@watrool can you make this change then?

if process.NODE_ENV === PRODUCTION, use chunkhash, otherwise use hash-id?

@smithad15
Copy link
Contributor

I would remove the hash completely for dev

@troyt-42
Copy link
Author

troyt-42 commented Nov 2, 2016

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

No branches or pull requests

3 participants