Problems to ignore URLs in CSS

0

How do I in Webpack to ignore the content with images inside the URL, eg

background-image: url("../img/marker.png");

I have an SASS file with this content:

// Fonts
@import url("http://fonts.googleapis.com/css?family=Roboto:300,400,700");
// Variables
@import "variables";
// Bootstrap
@import "~bootstrap-sass/assets/stylesheets/bootstrap";
// Font Awesome
@import "~font-awesome/css/font-awesome.css";
// CSS do Template
@import "../style.css";

And the webpack settings look like this:

plugins: [
    new webpack.ProvidePlugin({
        $: 'jquery',
        jQuery: 'jquery'
    })
],
module: {
    rules: [
        {
            test: /\.(png|jpg|gif)$/,
            use: [
                {
                    loader: 'file-loader',
                    options: {}
                }
            ]
        }
    ],
    loaders: [{

    }, {
        test: /\.css/,
        loader: ExtractTextPlugin.extract({
            use: [{
                loader: "css-loader",
                //options: { url: false }
            }]
        })
    }, {
        test: /\.(woff|.woff2|.ttf|.eot|.svg|.png|.jpg*.*)$/,
        loader: 'url-loader'
    }]
}

When I run npm run dev it gives me the following error:

> ERROR  Failed to compile with 2 errors                                                                                                                           14:57:24

These relative modules were not found:

* ../img/marker.png in ./node_modules/css-loader??ref--8-2!./node_modules/postcss-loader/lib??postcss!./resources/assets/style.css
* ../img/price-range-dragger.png in ./node_modules/css-loader??ref--8-2!./node_modules/postcss-loader/lib??postcss!./resources/assets/style.css

> ERROR in ./resources/assets/sass/app.scss
Module build failed: ModuleNotFoundError: Module not found: Error: Can't resolve '../img/marker.png' in 'D:\Dropbox\site-Frontend\resources\assets'
    
asked by anonymous 20.03.2018 / 19:13

0 answers