Parcourir la source

HUE-9458 [ui] UI build - Support custom webpack config files (sree)

sreenaths il y a 5 ans
Parent
commit
35d3e9fdb0
2 fichiers modifiés avec 12 ajouts et 6 suppressions
  1. 6 0
      docs/docs-site/content/developer/development/_index.md
  2. 6 6
      package.json

+ 6 - 0
docs/docs-site/content/developer/development/_index.md

@@ -938,6 +938,12 @@ To publish gethue to NPM registry, the following command would have to be run. K
 
 ## Building
 
+### Custom Webpack Config
+
+You can make webpack build with custom configuration files by setting HUE_WEBPACK_CONFIG environment variable.
+
+    HUE_WEBPACK_CONFIG="webpack.config.custom.js" make apps
+
 ### Dev Docker
 
 Try basic changes [in 3 minutes](https://gethue.com/quick-start-a-hue-development-environment-in-3-minutes-with-docker/) without compiling Hue locally hence avoiding the setting up of [dependencies](/developer/):

+ 6 - 6
package.json

@@ -134,13 +134,13 @@
   },
   "scripts": {
     "devinstall": "npm cache clean && npm install && npm prune",
-    "webpack": "webpack --config webpack.config.js",
-    "webpack-login": "webpack --config webpack.config.login.js",
-    "webpack-workers": "webpack --config webpack.config.workers.js",
-    "webpack-npm": "webpack --config webpack.config.npm.js",
+    "webpack": "webpack --config ${HUE_WEBPACK_CONFIG:-webpack.config.js}",
+    "webpack-login": "webpack --config ${HUE_WEBPACK_CONFIG_LOGIN:-webpack.config.login.js}",
+    "webpack-workers": "webpack --config ${HUE_WEBPACK_CONFIG_WORKERS:-webpack.config.workers.js}",
+    "webpack-npm": "webpack --config ${HUE_WEBPACK_CONFIG_NPM:-webpack.config.npm.js}",
     "publish-gethue": "npm run webpack-npm && cd npm_dist && npm publish",
-    "dev": "webpack --watch -d",
-    "dev-workers": "webpack --config webpack.config.workers.js --watch -d",
+    "dev": "webpack --watch --config ${HUE_WEBPACK_CONFIG:-webpack.config.js} -d",
+    "dev-workers": "webpack --config ${HUE_WEBPACK_CONFIG_WORKERS:-webpack.config.workers.js} --watch -d",
     "less": "./node_modules/.bin/grunt less",
     "less-dev": "./node_modules/.bin/grunt watch",
     "less-lint": "stylelint \"desktop/core/src/desktop/static/desktop/less/**/*.less\"",