configured of LESS Module in webpack

4.x.x
jayasanka 6 years ago
parent 2a5cc97de9
commit ea2dd0a024

@ -33,7 +33,7 @@
"html-webpack-plugin": "^3.2.0", "html-webpack-plugin": "^3.2.0",
"img-loader": "^3.0.1", "img-loader": "^3.0.1",
"less": "^3.9.0", "less": "^3.9.0",
"less-loader": "^4.0.4", "less-loader": "^4.1.0",
"mini-css-extract-plugin": "^0.5.0", "mini-css-extract-plugin": "^0.5.0",
"mocha": "^5.2.0", "mocha": "^5.2.0",
"mock-local-storage": "^1.0.5", "mock-local-storage": "^1.0.5",
@ -48,7 +48,7 @@
"react-intl": "^2.4.0", "react-intl": "^2.4.0",
"redux": "^4.0.1", "redux": "^4.0.1",
"sass-loader": "^6.0.7", "sass-loader": "^6.0.7",
"style-loader": "^0.18.1", "style-loader": "^0.18.2",
"url-loader": "^1.1.2", "url-loader": "^1.1.2",
"webpack": "^4.27.1", "webpack": "^4.27.1",
"webpack-cli": "^3.1.2", "webpack-cli": "^3.1.2",

@ -68,13 +68,22 @@ const config = {
}, },
{ {
test: /\.less$/, test: /\.less$/,
use: [{ use: [
loader: "style-loader" // creates style nodes from JS strings {
}, { loader: "style-loader" // creates style nodes from JS strings
loader: "css-loader" // translates CSS into CommonJS },
}, { {
loader: "less-loader" // compiles Less to CSS loader: "css-loader", // translates CSS into CommonJS
}] options: {
sourceMap: true,
modules: true,
localIdentName: "[local]___[hash:base64:5]"
}
},
{
loader: "less-loader" // compiles Less to CSS
}
]
}, },
{ {
test: /\.(woff|woff2|eot|ttf|svg)$/, test: /\.(woff|woff2|eot|ttf|svg)$/,

Loading…
Cancel
Save