pheuter / essential-react

A minimal skeleton for building testable React apps using Babel
MIT License
2.02k stars 131 forks source link

Less support #36

Closed viperfx closed 8 years ago

viperfx commented 8 years ago

It would be great to have an example of getting less support with this setup

Thanks

viperfx commented 8 years ago

Solved with

  // Transform source code using Babel and React Hot Loader
  module: {
    loaders: [
      { test: /\.jsx?$/, exclude: /node_modules/, loaders: ["react-hot", "babel-loader"] },
      { test: /\.less$/,  
        loader: ExtractTextPlugin.extract('style-loader', 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!less')
      }
    ]
  },

  // Automatically transform files with these extensions
  resolve: {
    extensions: ['', '.js', '.jsx', '.less', '.css']
  },