Files
talk-desktop/webpack.base.config.js
2025-01-19 22:58:03 +01:00

35 lines
662 B
JavaScript

/**
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
const { DefinePlugin } = require('webpack')
const CHANNEL = process.env.CHANNEL ?? 'dev'
module.exports = {
module: {
rules: [
{
test: /native_modules[/\\].+\.node$/,
use: 'node-loader',
},
{
test: /[/\\]node_modules[/\\].+\.(m?js|node)$/,
parser: { amd: false },
use: {
loader: '@vercel/webpack-asset-relocator-loader',
options: {
outputAssetBase: 'native_modules',
},
},
},
],
},
plugins: [
new DefinePlugin({
__CHANNEL__: JSON.stringify(CHANNEL),
}),
],
}