forked from mattermost/desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.main.js
69 lines (62 loc) · 1.78 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
60
61
62
63
64
65
66
67
68
69
// 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 path = require('path');
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/main.ts',
mainWindow: './src/main/preload/mainWindow.js',
dropdown: './src/main/preload/dropdown.js',
preload: './src/main/preload/mattermost.js',
modalPreload: './src/main/preload/modalPreload.js',
loadingScreenPreload: './src/main/preload/loadingScreenPreload.js',
},
output: {
path: path.join(__dirname, 'dist/'),
filename: '[name].js',
},
module: {
rules: [{
test: /\.(js|ts)?$/,
use: {
loader: 'babel-loader',
options: {
include: ['@babel/plugin-proposal-class-properties'],
},
},
}, {
test: /\.mp3$/,
use: {
loader: 'url-loader',
},
},
{
test: /\.node$/,
loader: 'awesome-node-loader',
options: {
name: '[name].[ext]',
rewritePath: path.resolve(__dirname, 'dist'),
},
}],
},
plugins: [
new CopyPlugin({
patterns: [{
from: 'assets/**/*',
context: 'src',
}],
}),
],
node: {
__filename: true,
__dirname: true,
},
target: 'electron-main',
});
/* eslint-enable import/no-commonjs */