lundi 21 août 2017

Can not using condition when require path less file with ExtractTextPlugin

I'm using ExtractTextPlugin to build less and css. I can build them easily with ExtractTextPlugin but when i using condition to load file dynamic so i met problem. This is my source:

if(THEME == 'a'){
   require( './theme/a.less');
} 
if(THEME == 'b'){
  require( './theme/b.less');
}
if(THEME == 'c'){
  require( './theme/c.less');
}

Result in bundle.css after build include 3 files (a.less, b.less, c.less). I', really expected just only contain file (a.less or b.less or c.less). I'm try to search before post this topic. Thanks all about helps




Aucun commentaire:

Enregistrer un commentaire