-
Notifications
You must be signed in to change notification settings - Fork 88
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
Production build uses versioning and the template doesn't point to that version #79
Comments
As an update to this, I'm now using the Netlify plugin to generate hashes - https://github.com/munter/netlify-plugin-hashfiles which seems to work quite well. |
That looks like an interesting approach. On one of my blogs, I used a Twig Extension to transform the |
@beryllium that looks great! If it's of any help, I use a similar approach for Wordpress to allow Symfony Encore to build assets, and then allow Wordpress to enqueue all files related to an entry. It works great with Encore's splitEntryChunks option, so multiple files can be made and auto-imported. https://gist.github.com/jonginn/21a025421fc9ebf3bf7025d043fa0349 |
Check https://github.com/sculpin/sculpin/blob/master/src/Sculpin/Bundle/TwigBundle/WebpackEncoreHelper.php (I'm using Config
Layout
|
When running in prod mode, the assets are made with Symfony Encore with versioning.
See webpack.config.js, line 17/18:
However in
_layouts/default.html
, this still uses the non-versioned file:Running these commands:
I would expect to get a production ready site but app.css does not exist. I would expect
default.html
to point toapp.HASH.css
. The same is true for the JS.Is there some way Sculpin can use
encore_entry_link_tags
andencore_entry_script_tags
as Symfony does, or similar? I would much rather use the versioned assets, as then it helps with caching. I can't see anywhere in the Sculpin docs that does this.I can see in this post from 2017 that "There is no easy way for Sculpin to handle the manifest.json file. Yet." is this something that's been resolved, or is the addition of
enableVersioning
in webpack.config.js an error?I can see this comment that seems to cover the same issue: sculpin/sculpin#354 (comment)
If there's no way to use Encore versioning, is there some way I can use
app.css?v={{ buildFragment }}
where buildFragment is a random number that's created every time the site is built?Thanks!
The text was updated successfully, but these errors were encountered: