aboutsummaryrefslogtreecommitdiffstats
path: root/webpack.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/webpack.config.js b/webpack.config.js
new file mode 100644
index 00000000000..caa6b9f0882
--- /dev/null
+++ b/webpack.config.js
@@ -0,0 +1,19 @@
+/**
+ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+const { merge } = require('webpack-merge')
+const config = require('./webpack.common.js')
+
+let isDev = false
+try {
+ const buildMode = process.env.NODE_ENV
+ isDev = buildMode === 'development'
+} catch (e) {
+ console.error('Could not determine build mode', e)
+}
+
+module.exports = merge(config, {
+ mode: isDev ? 'development' : 'production',
+ devtool: isDev ? 'cheap-source-map' : 'source-map',
+})