We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have a servicer worker where I have a list of files to be cached. Previous, I ran using .erb extension to get that, like this:
.erb
const CACHE_VERSION = 'v2'; const CACHE_NAME = CACHE_VERSION + ':sw-cache-'; function onInstall(event) { console.log('[Serviceworker]', "Installing!", event); event.waitUntil( caches.open(CACHE_NAME).then(function prefill(cache) { return cache.addAll([ '<%= asset_path "application.js" %>', '<%= asset_path "application.css" %>', '/offline.html', ]); }) ); }
Now I decided to move sw.js to esbuild build flow but I don't know how can I asset application.js file link there.
sw.js
application.js
Thanks!
The text was updated successfully, but these errors were encountered:
I also would like a way to get the asset_path in javascript.
For example, when I want to use customize the icon library for shoelace.style, I can do this:
registerIconLibrary("default", { resolver: (name) => `https://cdn.jsdelivr.net/npm/[email protected]/icons/${name}.svg` })
… but I can't refer to local assets and do something like:
registerIconLibrary("default", { resolver: (name) => asset_path(`icons/${name}.svg`) })
Sorry, something went wrong.
No branches or pull requests
I have a servicer worker where I have a list of files to be cached. Previous, I ran using
.erb
extension to get that, like this:Now I decided to move
sw.js
to esbuild build flow but I don't know how can I assetapplication.js
file link there.Thanks!
The text was updated successfully, but these errors were encountered: