I would submit a PR, but im new to the javascript/webpack stuff, so i dont know how to solve it on a good way. I guess require would not within the twig, because webpack will not "bundle" it then (or?).
The text was updated successfully, but these errors were encountered:
Ideally, when Bolt 4 is stable, it should require no assets that aren't local.
What needs to be done (in very broad strokes) is that a new 'vibrant.js' should be made in https://github.com/bolt/core/tree/master/assets/js , that would require the node-vibrant, and have that other code that's inlined in there. Then, that can be used with an {{ asset() }} tag in the twig.
Kinda like how zxcvbn.js is now used for the password strength thingy, only on the pages where it's needed.
Oh okay!
I already thought that this is the way to go, but i was uncertain if there is a better way for that.
Could you assign me the issue ? (I will check it this evening)
Get rid of the vibrant cdn: https://github.com/bolt/core/blob/master/templates/media/edit.html.twig#L175
https://yarnpkg.com/en/package/node-vibrant
I would submit a PR, but im new to the javascript/webpack stuff, so i dont know how to solve it on a good way. I guess require would not within the twig, because webpack will not "bundle" it then (or?).
The text was updated successfully, but these errors were encountered: