-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.main.js
52 lines (46 loc) · 1.04 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
const webpack = require('webpack');
const path = require(`path`);
var options = {
devtool: 'source-map',
target: 'electron-main',
entry: './src/main.js',
output: {
path: __dirname + '/build/',
publicPath: '',
filename: 'main.js',
sourceMapFilename: 'main.js.map',
chunkFilename: '[id].chunk.js'
},
resolve: {
extensions: ['.ts','.js','.jsx','.json', '.css', '.html']
},
/**
* Disables webpack processing of __dirname and __filename.
* If you run the bundle in node.js it falls back to these values of node.js.
* https://github.com/webpack/webpack/issues/2010
*/
node: {
__dirname: false,
__filename: false
},
plugins: [
new webpack.NamedModulesPlugin()
],
module: {
rules: [
{
test: /\.(png|jpg|gif|icns|html)$/,
exclude: path.resolve(__dirname, `env.json`),
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]'
}
}
]
}
]
}
};
module.exports = options;