diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-06-14 09:13:14 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-06-14 09:13:14 +0200 |
| commit | 13f9914757b2a72e77369859bbaec35339f31446 (patch) | |
| tree | 543651a0e2203f3a77f22fb12717ace80a68aae4 /mass-graducation/webpack.config.js | |
| parent | f911831563169c2e51ae409e110f534c9db54e4c (diff) | |
| download | bycs-sol-13f9914757b2a72e77369859bbaec35339f31446.tar.gz bycs-sol-13f9914757b2a72e77369859bbaec35339f31446.zip | |
mass-graduation: initial commit
Diffstat (limited to 'mass-graducation/webpack.config.js')
| -rw-r--r-- | mass-graducation/webpack.config.js | 36 |
1 files changed, 36 insertions, 0 deletions
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; +}; |
