Skip to content
New issue

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

Can't specify a full hostname as a root URL #236

Closed
kmck opened this issue Feb 24, 2016 · 3 comments
Closed

Can't specify a full hostname as a root URL #236

kmck opened this issue Feb 24, 2016 · 3 comments

Comments

@kmck
Copy link

kmck commented Feb 24, 2016

I'm trying to prepend a hostname to absolute URLs in my CSS (don't ask 😄) by doing something like this:

{
  loaders: [
    {
       test: /\.s?css$/,
       loader: 'css?root=http://some.cdn.com&sourceMap!postcss!sass?sourceMap',
    }
  ]
}

Doing this causes a bunch of errors because the // is being collapsed into a single /, resulting in URLs like http:/some.cdn.com/image.png in the compiled CSS, which look enough like relative paths to cause trouble and throw errors. I've discovered that using backslashes results in the absolute URLs I'm looking for, but that feels like a terrible hack that's just waiting to break at some point in the future.

I suspect this may be a problem deeper in the way query parameters are parsed in webpack, but I'd be happy with a solution or a cleaner workaround if anyone has ideas.

@micky2be
Copy link

I noticed that too. Very annoying.
I wonder if there is a work around.

@micky2be
Copy link

Just figured out the problem comes from webpack itself
See webpack/webpack#1466

@alexander-akait
Copy link
Member

Solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants