webpack.config.js 522 B

12345678910111213141516171819
  1. /**
  2. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  3. * SPDX-License-Identifier: AGPL-3.0-or-later
  4. */
  5. const { merge } = require('webpack-merge')
  6. const config = require('./webpack.common.js')
  7. let isDev = false
  8. try {
  9. const buildMode = process.env.NODE_ENV
  10. isDev = buildMode === 'development'
  11. } catch (e) {
  12. console.error('Could not determine build mode', e)
  13. }
  14. module.exports = merge(config, {
  15. mode: isDev ? 'development' : 'production',
  16. devtool: isDev ? 'cheap-source-map' : 'source-map',
  17. })