1

Is it possible to setup webpack, that I could use less in my html templates like:

// xy.html
<style type="text/less">
    color: @myColor;
</style>

Currently the css/less part of my webpack config looks like:

{
    test: /\.css$/i,
    loader: ['css-loader?esModule=false', 'less-loader'],
    issuer: /\.html?$/i
},
{
    test: /\.css$/i,
    loader: ['style-loader', 'css-loader'],
    issuer: /\.[tj]s$/i
},
{
    test: /\.less$/i,
    loader: ['css-loader?esModule=false', 'less-loader'],
    issuer: /\.html?$/i
},
{
    test: /\.less$/i,
    loader: ['style-loader', 'css-loader', 'less-loader'],
    issuer: /\.[tj]s$/i
},
{
    test: /\.html$/,
    use: [{
        loader: 'html-loader',
        options: {
            minimize: true
        }
    }]
},

Currently I am still using Webpack 4, as one of my dependencies does not yet support Webpack 5.

Thanks a lot for any help!

elitastic
  • 11
  • 3
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jan 24 '22 at 06:34

0 Answers0