aboutsummaryrefslogtreecommitdiffstats
path: root/webpack.common.js
diff options
context:
space:
mode:
Diffstat (limited to 'webpack.common.js')
-rw-r--r--webpack.common.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/webpack.common.js b/webpack.common.js
index aa937719f24..3b8da3d948a 100644
--- a/webpack.common.js
+++ b/webpack.common.js
@@ -4,14 +4,16 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
const { VueLoaderPlugin } = require('vue-loader')
+const { readFileSync } = require('fs')
const path = require('path')
+
const BabelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-modules-except')
const webpack = require('webpack')
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
const WorkboxPlugin = require('workbox-webpack-plugin')
+const WebpackSPDXPlugin = require('./build/WebpackSPDXPlugin.js')
const modules = require('./webpack.modules.js')
-const { readFileSync } = require('fs')
const appVersion = readFileSync('./version.php').toString().match(/OC_VersionString[^']+'([^']+)/)?.[1] ?? 'unknown'
@@ -152,14 +154,11 @@ module.exports = {
// Lazy load the Terser plugin
const TerserPlugin = require('terser-webpack-plugin')
new TerserPlugin({
- extractComments: {
- condition: /^\**!|@license|@copyright|SPDX-License-Identifier|SPDX-FileCopyrightText/i,
- filename: (fileData) => {
- // The "fileData" argument contains object with "filename", "basename", "query" and "hash"
- return `${fileData.filename}.license${fileData.query}`
- },
- },
+ extractComments: false,
terserOptions: {
+ format: {
+ comments: false,
+ },
compress: {
passes: 2,
},
@@ -239,6 +238,13 @@ module.exports = {
resourceRegExp: /^\.\/locale$/,
contextRegExp: /moment\/min$/,
}),
+
+ // Generate reuse license files
+ new WebpackSPDXPlugin({
+ override: {
+ select2: 'MIT',
+ }
+ }),
],
externals: {
OC: 'OC',