Created
April 16, 2017 11:43
-
-
Save crongro/ccc6c1e4f411c6111c35aa910f733acb to your computer and use it in GitHub Desktop.
webpack less loader (dev and production) - Creact React App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For webpack 1