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 Jul 18, 2019. It is now read-only.
I'm working on adding Rollup support to Sapper. Since Firefox doesn't yet support import() (and IE11 never will), and until you can use modules in workers, the plan is to use loadz0r.
There's a wrinkle: loadz0r loads modules like this...
script.src='./chunk-xyz123.js'
...but that URL is resolved relative to the page, not the importer. So if you have your scripts in a folder, or you're on a page other than /, the request fails.
Webpack solves this with options.publicPath. Rollup could do the same, but since it doesn't (normally) bundle a loader, perhaps it makes sense to implement that option here? In Sapper's case it would look like this:
loadz0r({publicPath: 'client'})
I'm not immediately sure what the most sensible approach is, but let me know if this is something you'd accept a PR for. Thanks!
The text was updated successfully, but these errors were encountered:
I think an option is the right way to go here. The only requirement I set for loadz0r is to not have path resolution logic in the loader. Very happy to accept a PR, otherwise I’ll whip something up next week :)
I'm working on adding Rollup support to Sapper. Since Firefox doesn't yet support
import()
(and IE11 never will), and until you can use modules in workers, the plan is to use loadz0r.There's a wrinkle: loadz0r loads modules like this...
...but that URL is resolved relative to the page, not the importer. So if you have your scripts in a folder, or you're on a page other than
/
, the request fails.Webpack solves this with
options.publicPath
. Rollup could do the same, but since it doesn't (normally) bundle a loader, perhaps it makes sense to implement that option here? In Sapper's case it would look like this:I'm not immediately sure what the most sensible approach is, but let me know if this is something you'd accept a PR for. Thanks!
The text was updated successfully, but these errors were encountered: