Skip to content

Instantly share code, notes, and snippets.

@crongro
Created April 16, 2017 11:43
Show Gist options
  • Save crongro/ccc6c1e4f411c6111c35aa910f733acb to your computer and use it in GitHub Desktop.
Save crongro/ccc6c1e4f411c6111c35aa910f733acb to your computer and use it in GitHub Desktop.
webpack less loader (dev and production) - Creact React App
// 1.dev.
{
test: /\.less$/,
include: paths.appSrc,
loaders: ["style", "css", "less", "postcss"]
}
//2, production
{
test: /\.less$/,
include: paths.appSrc,
loader: ExtractTextPlugin.extract('style', 'css?importLoaders=1!postcss!less-loader')
}
//plugin
new ExtractTextPlugin('public/style.css', {
allChunks: true
})
@crongro
Copy link
Author

crongro commented Apr 16, 2017

For webpack 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment