summaryrefslogtreecommitdiff
path: root/config/webpack.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'config/webpack.config.js')
-rw-r--r--config/webpack.config.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/config/webpack.config.js b/config/webpack.config.js
index f69a799ebcf..3a43f515a1b 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -1,5 +1,6 @@
const path = require('path');
const glob = require('glob');
+const fs = require('fs');
const webpack = require('webpack');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const StatsWriterPlugin = require('webpack-stats-plugin').StatsWriterPlugin;
@@ -23,6 +24,7 @@ const NO_SOURCEMAPS = process.env.NO_SOURCEMAPS;
const VUE_VERSION = require('vue/package.json').version;
const VUE_LOADER_VERSION = require('vue-loader/package.json').version;
+const WEBPACK_VERSION = require('webpack/package.json').version;
const devtool = IS_PRODUCTION ? 'source-map' : 'cheap-module-eval-source-map';
@@ -359,6 +361,21 @@ module.exports = {
console.log(`Webpack heap size: ${toMB(memoryUsage)} MB`);
+ const webpackStatistics = {
+ memoryUsage,
+ date: Date.now(), // milliseconds
+ commitSHA: process.env.CI_COMMIT_SHA,
+ nodeVersion: process.versions.node,
+ webpackVersion: WEBPACK_VERSION,
+ };
+
+ console.log(webpackStatistics);
+
+ fs.writeFileSync(
+ path.join(ROOT_PATH, 'webpack-dev-server.json'),
+ JSON.stringify(webpackStatistics),
+ );
+
// exit in case we're running webpack-dev-server
IS_DEV_SERVER && process.exit();
});