You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.
sometimes, file names are dynamically generated through javascript.
This means that the parser won't understand that as an url and the file won't be included in the final build.
Review implementation based on CLI flag --include <glob>
pakku index.html build --include products/**
However, this also means versionised file names will eventually break on javascript call like.
getImage('products/' + number + '.jpg');
With that in mind, adding a route map object on the script containing invocation to those images might be a good idea. This way, pack would inject the pakku object inside window scope including file routing.
sometimes, file names are dynamically generated through javascript.
This means that the parser won't understand that as an url and the file won't be included in the final build.
Review implementation based on CLI flag
--include <glob>
pakku index.html build --include products/**
However, this also means versionised file names will eventually break on javascript call like.
getImage('products/' + number + '.jpg');
With that in mind, adding a route map object on the script containing invocation to those images might be a good idea. This way, pack would inject the
pakku
object insidewindow
scope including file routing.from the same script, the user can add the following method to implement pack compatibility.
function getImage(src) { return window.pakku && window.pakku[src] || src; }
falling back, gracefully on development.
Once the parser find a mention to ``window.pakku
or
pakku` inside the script, it will automatically prepend the routing object to it.The text was updated successfully, but these errors were encountered: