forked from mattermost/desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.main.js
59 lines (53 loc) · 1.52 KB
/
webpack.config.main.js
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
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// Copyright (c) 2015-2016 Yuya Ochiai
// This files uses CommonJS.
/* eslint-disable import/no-commonjs */
'use strict';
const {merge} = require('webpack-merge');
const CopyPlugin = require('copy-webpack-plugin');
const base = require('./webpack.config.base');
module.exports = merge(base, {
entry: {
index: './src/main/app/index.ts',
desktopAPI: './src/main/preload/desktopAPI.js',
preload: './src/main/preload/mattermost.js',
callsWidget: './src/main/preload/callsWidget.js',
},
externals: {
'macos-notification-state': 'require("macos-notification-state")',
'windows-focus-assist': 'require("windows-focus-assist")',
},
module: {
rules: [{
test: /\.(js|ts)?$/,
use: {
loader: 'babel-loader',
options: {
include: ['@babel/plugin-proposal-class-properties'],
},
},
}, {
test: /\.mp3$/,
type: 'asset/inline',
},
{
test: /\.node$/,
loader: 'node-loader',
}],
},
plugins: [
new CopyPlugin({
patterns: [{
from: 'assets/**/*',
context: 'src',
}],
}),
],
node: {
__filename: true,
__dirname: true,
},
target: 'electron-main',
});
/* eslint-enable import/no-commonjs */