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

URLs are not supported in production public_path due to leading slash #83

@gkaemmer

Description

@gkaemmer

Hello! Loving webpack-rails, really has been a game changer getting our code migrated away from sprockets.

We deliver our assets from a CDN, so it makes sense for us to define config.webpack.public_path = '//cdn.url.com/assets/webpack'. The problem with this is that manifest.rb always adds a slash before the public path.

Weirdly, the resulting URLs (like "///sub.domain.com/assets/webpack/app.js") work in most browsers, but not all! In IE11 and other old browsers, the public path gets parsed incorrectly, prevent the assets from being loaded.

A workaround is removing one (but not both) of the leading slashes on our CDN url. But this is pretty weird. Is there another way to tell webpack to load assets from another domain?

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