mariusbalcytis / webpack-bundle

Bundle to Integrate Webpack into Symfony
MIT License
122 stars 36 forks source link

Request option to not add random identifier in compiled file name #80

Open PierreNansot opened 6 years ago

PierreNansot commented 6 years ago

Hey,
I recently tried Symfony Encore bundle. It was nothing compare to yours in term of usability but there is at least something they do right.
It's keeping prod's compiled files name consistent.

In my case, i deploy my project on a PaaS service with a simple git push. To ease my deploy, i compile on my computer my front-end which is recommended by Symfony and my hoster.
Everytime i have to deploy, i compile with the command line, remove previous files, add to git new files and then commit before pushing.
I could substract 2 actions if the name of the compiled files were the same.

If it's not a burden on you, i'd appreciate.
Thanks

mvrhov commented 6 years ago

AFAIk, everything you need to do is change the chunk name inside webpack.config.js

mariusbalcytis commented 6 years ago

If the names are the same, you loose cache busting - you either cannot cache your assets or your users can see old files instead of newly compiled ones. Filenames include hashes, so they only change when their content changes.

If you really appreciate your dev-flow more than performance for your users, you can configure chunkname in config.js, as @mvrhov has mentioned.

Otherwise the bundle could cleanup the output directory before compiling automatically, if configured. Would such a feature be convenient for you? I imagine special command line option could be used for that. Just to mention, this would require that output directory would contain webpack generated files only.

PierreNansot commented 6 years ago

Thanks for the feedback.
Indeed, i forgot about cache busting. Does it seem possible to include the hash in the Githubissues.

  • Githubissues is a development platform for aggregating issues.