forked from mattermost/desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.renderer.js
78 lines (72 loc) · 1.73 KB
/
webpack.config.renderer.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
70
71
72
73
74
75
76
77
78
// Copyright (c) 2015-2016 Yuya Ochiai
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// This file uses CommonJS.
/* eslint-disable import/no-commonjs */
'use strict';
const path = require('path');
const merge = require('webpack-merge');
const base = require('./webpack.config.base');
module.exports = merge(base, {
entry: {
index: './src/browser/index.jsx',
settings: './src/browser/settings.jsx',
updater: './src/browser/updater.jsx',
'webview/mattermost': './src/browser/webview/mattermost.js',
},
output: {
path: path.join(__dirname, 'src/browser'),
publicPath: 'browser',
filename: '[name]_bundle.js',
},
module: {
rules: [{
test: /\.(js|jsx)?$/,
use: {
loader: 'babel-loader',
},
}, {
test: /\.css$/,
use: [
{loader: 'style-loader'},
{loader: 'css-loader'},
],
}, {
test: /\.mp3$/,
use: {
loader: 'url-loader',
},
}, {
test: /\.(svg)$/,
use: [
{
loader: 'file-loader',
options: {
name: '[hash].[ext]',
publicPath: './',
},
},
{loader: 'image-webpack-loader'},
],
}, {
test: /\.(eot|ttf|woff|woff2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: '/../assets/fonts',
publicPath: './assets/fonts',
},
}],
},
node: {
__filename: true,
__dirname: true,
},
target: 'electron-renderer',
devServer: {
contentBase: path.join(__dirname, 'src'),
inline: true,
publicPath: '/browser/',
},
});
/* eslint-enable import/no-commonjs */