Skip to content

Images are not anymore converted to data URI #1337

Closed
@dilyanpalauzov

Description

@dilyanpalauzov

I use webpack 5.44. My webpack.config.js contains (not complete content):

export default {
    experiments: {
        outputModule: true
    },
    output: {
        library: {
            type: 'module'
        },
        filename: 'abc.js',
        publicPath: '/dist'
    },
    module: {
        rules: [{
            test: /\.styl$/,
            use: [
                MiniCssExtractPlugin.loader,
                preprocessLoader,
                {
                    loader: 'css-loader'
                },
                {
                    loader: 'stylus-loader'
                }
            ]
    },
    plugins: [
        new ESLintPlugin({}),
        new MiniCssExtractPlugin({
            filename: 'abc.css'
        }),
   ]
}

With css-loader 5.2.7 the images in the input stylus were embedded as data-URL in the output CSS. With css-loader 6, the images are instead moved to the output directory. Let me add, that the input src/ndex.js is itself ES6 module:

import abc from './js/abc.js';

import './css/main.styl';

export default abc;

What do I have to change, in order to have the images further converted to data-urls in the resulting css?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions