Skip to content
This repository was archived by the owner on Jul 18, 2019. It is now read-only.
This repository was archived by the owner on Jul 18, 2019. It is now read-only.

publicPath option #9

Closed
Closed
@Rich-Harris

Description

@Rich-Harris

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions