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
Named chunks ignoring names when requiring modules at runtime #358
Comments
Guessing from the documentation your config should be using output:
namedChunkFilename: '[name]-[hash].js' |
Ok, that's something for @sokra 😁 |
It's pretty simple: We should propably remove I assume your app works fine if you simply omit the |
Thanks for the reply. Yes, that all makes sense.
The docs say the following are supported
Yes it works when I remove the the With Which makes it slightly hard to identify the chunk. '[name]-[hash].js' would be a great format because it would allow identifiable chunk files which can share a single hash for easy revisioning. What do you think? |
Why do you want identifiable chunk filenames? You can use the stats to identify the files. |
I have a couple reasons, but I would be happy to hear a better way to do it
|
Fantastic, how does process work for commits to become part of the npm package. Basically what I am trying to ask is, how can I get this awesomeness today? Thanks alot. |
yes, you can use it now... I publish every commit to master as fast as possible within a |
Super, thanks again Sokra! |
Works great! |
👍 @sokra for fast |
Just stumbled upon this. The docs do not yet reflect the change right? I would be willing to update them, if that's OK. |
Thanks for creating this demo, it is just what I needed to see your Flask/Webpack projects in action. I got this error when I ran: npm start ... ERROR in chunk app_css [entry] [name].[chunkhash].js Cannot use [chunkhash] for chunk in '[name].[chunkhash].js' (use [hash] instead) ERROR in chunk app_js [entry] [name].[chunkhash].js Cannot use [chunkhash] for chunk in '[name].[chunkhash].js' (use [hash] instead) ... It appears to be related to: webpack/webpack#358 I'm new to webpack but this code change seemed to have fixed it.
Hey guys, firstly webpack is great.
I am having some trouble with code splitting. I am trying to have 2 named chunks for two routes in my application which are not often visited. mysite.com/settings and mysite.com/access.
here is my webpack.config.coffee
And here is my router.coffee
I am not using the webpack dev-server, instead I am watching simply by using the following cmd-line tool
The problem is that it ignores the names when requiring the files, as you can see the format is '[name]-[chunkhash].js' it generates files with the correct format e.g. settings-2j3nekj2n3ejkn2.js but during development, when I attempt to load the page, the browser complains that '-2j3nekj2n3ejkn2.js' cannot be found, somehow the mapping of the files, ignores the names. If I leave out the names, then it works.
Generated files
Chrome error
So the question is how can I setup mulitple named chunks correctly (or is there a bug). Thanks in advance.
Note I have checked out their examples in the docs at https://github.com/webpack/docs/wiki/code-splitting
and I have followed their optimization docs aswell at https://github.com/webpack/docs/wiki/optimization
and I also posted the question on stackoverflow
http://stackoverflow.com/questions/24743114/webpack-multiple-named-chunks-ignoring-names-at-runtime
But I am still stuck
The text was updated successfully, but these errors were encountered: