I'm responsible for a Laravel web app that serves multiple pages, each one being a React "SPA". When I deploy on production I run a build script that will:
Then I commit everything and deploy.
One of the things I would like to improve is regarding the views and the hashes. Currently I rely on some conventions to get the whole setup working. For example, the name of the Webpack entries have to be the name of the views. So, I can find the right file to inject the updated file names.
I would like a more declarative approach and I'm writing a library to solve this problem using a configuration file, updated by Webpack, to know what to inject and where.
So, my questions are:
Thank you!
EDIT I wrote an open-source project to address this problem and other problems about managing assets in frontend applications: Frontend Assets Manager
Any feedback is welcome!
Sebastian
I’m not 100% sure if it’s something you’re looking for but I use hashes in filenames too and I manage to update/insert the references with the Html-webpage-plugin. I use this with a template html file where the references to js and css got injected on build.
github.com/jantimon/html-webpack-plugin/blob/mast…
This is my repo with a sample project where I develop and maintain my configuration. The Webpack 4 branch is still WIP though
github.com/HerrVoennchen/sample-project
May it’ll help you with your configuration