From ea2dd0a024bd77473b95b2320801b34b08d339ba Mon Sep 17 00:00:00 2001 From: jayasanka Date: Tue, 19 Mar 2019 22:41:17 +0530 Subject: [PATCH] configured of LESS Module in webpack --- .../react-app/package.json | 4 ++-- .../react-app/webpack.config.js | 23 +++++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json index 57761af6ca0..277146278a2 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json @@ -33,7 +33,7 @@ "html-webpack-plugin": "^3.2.0", "img-loader": "^3.0.1", "less": "^3.9.0", - "less-loader": "^4.0.4", + "less-loader": "^4.1.0", "mini-css-extract-plugin": "^0.5.0", "mocha": "^5.2.0", "mock-local-storage": "^1.0.5", @@ -48,7 +48,7 @@ "react-intl": "^2.4.0", "redux": "^4.0.1", "sass-loader": "^6.0.7", - "style-loader": "^0.18.1", + "style-loader": "^0.18.2", "url-loader": "^1.1.2", "webpack": "^4.27.1", "webpack-cli": "^3.1.2", diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/webpack.config.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/webpack.config.js index bf87b97763e..50192db9ff4 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/webpack.config.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/webpack.config.js @@ -68,13 +68,22 @@ const config = { }, { test: /\.less$/, - use: [{ - loader: "style-loader" // creates style nodes from JS strings - }, { - loader: "css-loader" // translates CSS into CommonJS - }, { - loader: "less-loader" // compiles Less to CSS - }] + use: [ + { + loader: "style-loader" // creates style nodes from JS strings + }, + { + 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)$/,