diff options
| author | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2025-04-28 17:05:38 +0200 |
|---|---|---|
| committer | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2025-04-28 17:05:38 +0200 |
| commit | 685cf6805e1f3c10111f6e62d88f2fa3ffdfd12d (patch) | |
| tree | 24b2ef968d9703a44afe28ed009fe287f40757f1 /webpack.common.js | |
| parent | 3539991a6e0bd7ea5c2be93bd5958513e940b70e (diff) | |
Revert "Externalize vue using `externalsType: 'global'`."
This reverts commit 251fdf728130d26abaac55d3835db8d26e05cb40.
Diffstat (limited to 'webpack.common.js')
| -rw-r--r-- | webpack.common.js | 113 |
1 files changed, 45 insertions, 68 deletions
diff --git a/webpack.common.js b/webpack.common.js index 612895b..291d3a4 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -1,73 +1,68 @@ -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'); +const path = require("path"); +const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const { VueLoaderPlugin } = require('vue-loader'); +const ESLintPlugin = require('eslint-webpack-plugin'); -const assetsPath = path.resolve(__dirname, 'resources/assets/javascripts'); +const assetsPath = path.resolve(__dirname, "resources/assets/javascripts"); module.exports = { entry: { - 'studip-base': assetsPath + '/entry-base.js', - 'studip-statusgroups': assetsPath + '/entry-statusgroups.js', - 'studip-wysiwyg': assetsPath + '/entry-wysiwyg.js', - 'studip-installer': assetsPath + '/entry-installer.js', - print: path.resolve(__dirname, 'resources/assets/stylesheets') + '/print.scss', - accessibility: path.resolve(__dirname, 'resources/assets/stylesheets') + '/highcontrast.scss', + "studip-base": assetsPath + "/entry-base.js", + "studip-statusgroups": assetsPath + "/entry-statusgroups.js", + "studip-wysiwyg": assetsPath + "/entry-wysiwyg.js", + "studip-installer": assetsPath + "/entry-installer.js", + "print": path.resolve(__dirname, "resources/assets/stylesheets") + "/print.scss", + "accessibility": path.resolve(__dirname, "resources/assets/stylesheets") + "/highcontrast.scss" }, output: { - path: path.resolve(__dirname, 'public/assets'), - chunkFilename: 'javascripts/[id].chunk.js?h=[chunkhash]', - filename: 'javascripts/[name].js', - clean: { - keep: /^(fonts|images|javascripts\/mathjax|sounds|stylesheets\/\.gitkeep)/, - }, + path: path.resolve(__dirname, "public/assets"), + chunkFilename: "javascripts/[id].chunk.js?h=[chunkhash]", + filename: "javascripts/[name].js" }, module: { rules: [ { test: /ckeditor5-[^/\\]+[/\\]theme[/\\]icons[/\\][^/\\]+\.svg$/, - use: ['raw-loader'], + use: [ 'raw-loader' ] }, { test: /\.css$/, use: [ { - loader: MiniCssExtractPlugin.loader, + loader: MiniCssExtractPlugin.loader }, { - loader: 'css-loader', + loader: "css-loader", options: { url: false, - importLoaders: 1, - }, + importLoaders: 1 + } }, { - loader: 'postcss-loader', - }, - ], + loader: "postcss-loader", + } + ] }, { test: /\.scss$/, use: [ { - loader: MiniCssExtractPlugin.loader, + loader: MiniCssExtractPlugin.loader }, { - loader: 'css-loader', + loader: "css-loader", options: { url: false, - importLoaders: 2, - }, + importLoaders: 2 + } }, { - loader: 'postcss-loader', + loader: "postcss-loader" }, { - loader: 'sass-loader', - }, - ], + loader: "sass-loader" + } + ] }, { test: /\.ts$/, @@ -83,9 +78,9 @@ module.exports = { use: { loader: 'babel-loader', options: { - cacheDirectory: true, - }, - }, + cacheDirectory: true + } + } }, { test: /\.vue$/, @@ -94,30 +89,17 @@ module.exports = { compilerOptions: { isCustomElement(tag) { return ['altcha-widget'].includes(tag); - }, - }, - }, - }, - ], + } + } + } + } + ] }, 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', - chunkFilename: 'stylesheets/[name].css?h=[chunkhash]', + filename: "stylesheets/[name].css", + chunkFilename: "stylesheets/[name].css?h=[chunkhash]", ignoreOrder: true, }), new ESLintPlugin({ @@ -128,9 +110,9 @@ module.exports = { 'resources/assets/javascripts/jquery/autoresize.jquery.min.js', 'resources/assets/javascripts/jquery/jstree/jquery.jstree.js', 'resources/assets/javascripts/vendor', - ], + ] }), - ].filter(Boolean), + ], resolve: { alias: { 'jquery-ui/data': 'jquery-ui/ui/data', @@ -157,13 +139,8 @@ module.exports = { }, extensions: ['.ts', '.vue', '.js'], fallback: { - stream: require.resolve('stream-browserify'), - buffer: require.resolve('buffer/'), - }, - }, - externals: { - vue: 'Vue', - vuex: 'Vuex', - }, - externalsType: 'global', + 'stream': require.resolve("stream-browserify"), + 'buffer': require.resolve("buffer/") + } + } }; |
