-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
77 lines (73 loc) · 1.85 KB
/
webpack.config.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
var path = require('path')
const webpack = require('webpack')
const NotifierPlugin = require('webpack-notifier')
const resolve = require('path').resolve
const CleanPlugin = require('clean-webpack-plugin')
const externalDeps = [ 'nconf', 'sqlite3' ]
module.exports = {
devtool: 'source-map',
entry: {
"index.js": './index.js',
"main.js": './main.js',
"entry.js": './entry.js'
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name]',
libratyTarget: 'var',
sourceMapFilename: '[name].map'
},
module: {
loaders: [{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/,
include: __dirname
},
{
test: /\.scss$/,
loader: 'style!css!sass'
},
{
test: /\.css$/,
loader: 'style!css'
},
{
test: /\.(png|jpg|gif|bmp|ico|otf|eot|ttf|woff)$/,
loader: 'url'
},
{
test: /\.json$/,
loader: 'json'
}]
},
target: 'electron',
node: {
__filename: true,
__dirname: true,
setImmediate: true
},
resolve: {
extensions: [ '', '.json', '.js', '.jsx' ],
},
_externalDeps: externalDeps,
plugins: [
new NotifierPlugin({ alwaysNotify: true }),
new webpack.ExternalsPlugin('commonjs', externalDeps),
new webpack.DefinePlugin({
// 'console': 'global._console || console',
// 'window.console': 'global._console || console',
// 'global.console': 'global._console || console',
'window.localStorage': 'global._mainWin.localStorage',
'localStorage': 'global._mainWin.localStorage',
}),
new CleanPlugin([ resolve(__dirname, 'dist')]),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('development') }),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
"window.jQuery": 'jquery'
})
],
}