From be1ee6940526bd5eb6bc2637e8b1fa5503c187dd Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Willms Date: Fri, 20 Jun 2025 08:23:04 +0200 Subject: use different build for different webpack envs to enable Vue DevTools in browser, fixes #5652 Closes #5652 Merge request studip/studip!4268 --- webpack.common.js | 13 ------------- webpack.dev.js | 13 +++++++++++++ webpack.prod.js | 17 ++++++++++++++++- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/webpack.common.js b/webpack.common.js index e2c24cd..e9bd264 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -1,5 +1,4 @@ const { RsdoctorWebpackPlugin } = require('@rsdoctor/webpack-plugin'); -const CopyPlugin = require('copy-webpack-plugin'); const ESLintPlugin = require('eslint-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const path = require('path'); @@ -103,18 +102,6 @@ module.exports = { }, plugins: [ process.env.RSDOCTOR && new RsdoctorWebpackPlugin({}), - new CopyPlugin({ - patterns: [ - { - from: './node_modules/vue/dist/vue.global.prod.js', - to: './javascripts/vue.global.prod.js', - }, - { - from: './node_modules/vuex/dist/vuex.global.prod.js', - to: './javascripts/vuex.global.prod.js', - }, - ], - }), new VueLoaderPlugin(), new MiniCssExtractPlugin({ filename: 'stylesheets/[name].css', diff --git a/webpack.dev.js b/webpack.dev.js index 6d5da00..1137eb5 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -1,6 +1,7 @@ const webpack = require('webpack'); const { merge } = require('webpack-merge'); const common = require('./webpack.common.js'); +const CopyPlugin = require('copy-webpack-plugin'); const WebpackNotifierPlugin = require('webpack-notifier'); const path = require('path'); @@ -13,6 +14,18 @@ module.exports = merge(common, { mode: 'development', devtool: false, plugins: [ + new CopyPlugin({ + patterns: [ + { + from: './node_modules/vue/dist/vue.global.js', + to: './javascripts/vue.global.prod.js', + }, + { + from: './node_modules/vuex/dist/vuex.global.js', + to: './javascripts/vuex.global.prod.js', + }, + ], + }), new webpack.WatchIgnorePlugin({ paths:[ /\.d\.[cm]ts$/ diff --git a/webpack.prod.js b/webpack.prod.js index 6378db5..9fb89f7 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -1,5 +1,6 @@ const CssMinimizerPlugin = require('css-minimizer-webpack-plugin') const TerserPlugin = require('terser-webpack-plugin') +const CopyPlugin = require('copy-webpack-plugin'); const common = require('./webpack.common.js') const webpack = require('webpack') const { merge } = require('webpack-merge') @@ -27,5 +28,19 @@ module.exports = merge(common, { }, }), ] - } + }, + plugins: [ + new CopyPlugin({ + patterns: [ + { + from: './node_modules/vue/dist/vue.global.prod.js', + to: './javascripts/vue.global.prod.js', + }, + { + from: './node_modules/vuex/dist/vuex.global.prod.js', + to: './javascripts/vuex.global.prod.js', + }, + ], + }), + ] }) -- cgit v1.0