search

Home  >  Q&A  >  body text

javascript - webpack less file packaged separately error

{
        test: /\.less$/, 
        loader: "style-loader!css-loader!less-loader"
 }

This is packaged to the head, but I want to package it into a separate file, so I changed it to

 {
        test: /\.less$/, 
        loader:ExtractTextPlugin.extract("style-loader","css-loader","less-loader")
 }

The packaged style is equivalent to copying the content in the less file. My content in the less file is as follows:

@color:yellow;

html{
    border:10px solid @color;
}

The packaged style is also like this

@color:yellow;

html{
    border:10px solid @color;
}

Is this what is the reason?

给我你的怀抱给我你的怀抱2770 days ago749

reply all(1)I'll reply

  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-06-26 11:00:03

    It seems to be the writing method of webpack1.x, you can refer to https://github.com/webpack-contrib/extract-text-webpack-plugin/blob/webpack-1/README.md

    reply
    0
  • Cancelreply