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

relative urls to images in css point to the wrong place #27

Closed
@brainkim

Description

@brainkim

I'm trying to compile a legacy css file. In this legacy file, there are relative url like `background-image: url(../images/cta-newsletter.png), which get resolved according to the location of the stylesheet. Unfortunately, the extract-text-plugin (or maybe one of the loaders?) will remove this relative url.
I use the url-loader for images like this:

{ test: /\.(png|jpg)$/,
  loader: 'url-loader?name=images/[name].[ext]&limit=8192' },

and the ExtractTextPlugin is added to the plugins array like this:

[..., new ExtractTextPlugin('css/[name].css'),]

so that compiled images and css files go into images and css respectively in the build dir, which mirrors what the src dir looks like.

Am I doing something wrong or crazy? Is there a way to have this plugin keep track of relative urls? Lemme know if this is unclear and I'll explain further.

Thank you!
Brian

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions