aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/scripts/build.js
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2019-03-27 16:06:20 +0100
committersonartech <sonartech@sonarsource.com>2019-03-29 09:45:00 +0100
commitcb53cd80dd1167d68caaee15cfcec058b01fff5d (patch)
treea37d015c56108b406dd2130cacc9ec447aec1863 /server/sonar-web/scripts/build.js
parent0c5b4644cf0ca5487516c581530c67a86bc0342f (diff)
downloadsonarqube-cb53cd80dd1167d68caaee15cfcec058b01fff5d.tar.gz
sonarqube-cb53cd80dd1167d68caaee15cfcec058b01fff5d.zip
Improve front end local build time
Diffstat (limited to 'server/sonar-web/scripts/build.js')
-rw-r--r--server/sonar-web/scripts/build.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/server/sonar-web/scripts/build.js b/server/sonar-web/scripts/build.js
index 4e0c66a7bf5..6717054f361 100644
--- a/server/sonar-web/scripts/build.js
+++ b/server/sonar-web/scripts/build.js
@@ -25,10 +25,13 @@ const webpack = require('webpack');
const reportBuildStats = require('./utils/reportBuildStats');
const getConfigs = require('../config/webpack.config');
-const configs = getConfigs({ production: true });
+const release = process.argv.findIndex(val => val === 'release') >= 0;
+const configs = getConfigs({ production: true, release }).filter(
+ config => release || config.name === 'modern'
+);
function build() {
- console.log(chalk.cyan.bold('Creating optimized production build...'));
+ console.log(chalk.cyan.bold(`Creating ${release ? 'optimized' : 'fast'} production build...`));
console.log();
webpack(configs, (err, stats) => {
@@ -38,8 +41,10 @@ function build() {
process.exit(1);
}
reportBuildStats(stats.stats[0], 'modern');
- console.log();
- reportBuildStats(stats.stats[1], 'legacy');
+ if (release) {
+ console.log();
+ reportBuildStats(stats.stats[1], 'legacy');
+ }
console.log(chalk.green.bold('Compiled successfully!'));
});
}