From 13f9914757b2a72e77369859bbaec35339f31446 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 14 Jun 2026 09:13:14 +0200 Subject: mass-graduation: initial commit --- mass-graducation/webpack.config.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 mass-graducation/webpack.config.js (limited to 'mass-graducation/webpack.config.js') diff --git a/mass-graducation/webpack.config.js b/mass-graducation/webpack.config.js new file mode 100644 index 0000000..154c454 --- /dev/null +++ b/mass-graducation/webpack.config.js @@ -0,0 +1,36 @@ +const webpack = require('webpack'); +const path = require('path'); + +const isProduction = process.env.NODE_ENV === 'production'; +const isMock = process.env.NODE_ENV === 'mock'; + +const config = { + entry: './src/main.js', + output: { + path: path.resolve(__dirname, 'dist'), + }, + plugins: [ + new webpack.NormalModuleReplacementPlugin( + /-ENV.js/, + (resource) => { + resource.request = resource.request.replace( + /-ENV/, + `-${isMock ? "mock" : "prod"}`, + ); + + if (resource.createData) { + resource.createData.request = resource.request; + } + } + ) + ], +}; + +module.exports = () => { + if (isProduction) { + config.mode = 'production'; + } else { + config.mode = 'development'; + } + return config; +}; -- cgit v1.2.3