U
U
uzi_no_uzi2020-02-05 12:51:37
webpack
uzi_no_uzi, 2020-02-05 12:51:37

Is it possible to create sourceMap when using less-loader?

I connect less-loader

{
    test: /\.less$/,
    use: [
        MiniCssExtractPlugin.loader,
        {
            loader: "css-loader",
            options: {
                sourceMap: true,
            }
        },
        {
            loader: "less-loader",
            options: {
                sourceMap: true,
            }
        }
    ]
}


I connect less-loader

{
    test: /\.less$/,
    use: [
        MiniCssExtractPlugin.loader,
        {
            loader: "css-loader",
            options: {
                sourceMap: true,
            }
        },
        {
            loader: "less-loader",
            options: {
                sourceMap: true,
            }
        }
    ]
}


Expand Fragment

The documentation says to set the sourceMap option for less-loader and css-loader. That's exactly what I did.

The problem is that sourceMap is not written for source files, but for final files, in which case sourceMap makes no sense.

5e3a901dab9d4641871110.png
5e3a90258f5a1640421912.png

Is it possible to get sourceMap for less source files?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question