-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathwebpack.main.config.js
More file actions
47 lines (42 loc) · 1006 Bytes
/
webpack.main.config.js
File metadata and controls
47 lines (42 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
const path = require('node:path')
const webpack = require('webpack')
const { merge } = require('webpack-merge')
const baseConfig = require('./webpack.base.config.js')
const { resolveConfig } = require('./build/resolveBuildConfig.js')
module.exports = merge(baseConfig, {
entry: path.resolve(__dirname, './src/main.js'),
output: {
assetModuleFilename: '[file]',
},
module: {
rules: [
{
test: /\.ts$/,
loader: 'esbuild-loader',
options: {
target: 'es2022',
},
},
{
test: /\.(png|ico|icns)$/,
include: path.resolve(__dirname, './img/icons'),
type: 'asset/resource',
},
// Chromium extension
{
test: /\.crx$/,
include: path.resolve(__dirname, './resources'),
type: 'asset/resource',
},
],
},
plugins: [
new webpack.DefinePlugin({
__BUILD_CONFIG__: JSON.stringify(resolveConfig()),
}),
],
})