-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
97 lines (92 loc) · 2.83 KB
/
webpack.config.js
File metadata and controls
97 lines (92 loc) · 2.83 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// webpack.config.js
var webpack = require('webpack')
var webpackUglifyJsPlugin = require('webpack-uglify-js-plugin')
var path = require('path')
var bower_dir = __dirname + '/app/bower_components'
var node_dir = __dirname + '/app/node_modules'
var app = {
context: __dirname + '/app',
entry: {
app: './app.js',
},
target: 'electron-renderer',
output: {
path: __dirname + '/app/build',
filename: "[name].entry.js",
publicPath: 'http://localhost:8080/app/build/'
},
resolve: {
alias: {
'jquery': node_dir + '/jquery/src/jquery.js'
}
},
plugins: [
new webpackUglifyJsPlugin({
cacheFolder: path.resolve(__dirname, 'public/cached_uglify/'),
debug: true,
minimize: true,
sourceMap: false,
output: {
comments: false
},
compressor: {
warnings: false
}
}),
new webpack.ProvidePlugin({
$: "jquery",
'window.$': "jquery",
jQuery: "jquery",
"windows.jQuery": "jquery",
MediumEditor: "medium-editor"
})
],
module: {
loaders: [{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
{ test: /\.svg$/, loader: 'url-loader?limit=65000&mimetype=image/svg+xml&name=public/fonts/[name].[ext]' },
{ test: /\.woff$/, loader: 'url-loader?limit=65000&mimetype=application/font-woff&name=public/fonts/[name].[ext]' },
{ test: /\.woff2$/, loader: 'url-loader?limit=65000&mimetype=application/font-woff2&name=public/fonts/[name].[ext]' },
{ test: /\.[ot]tf$/, loader: 'url-loader?limit=65000&mimetype=application/octet-stream&name=public/fonts/[name].[ext]' },
{ test: /\.eot$/, loader: 'url-loader?limit=65000&mimetype=application/vnd.ms-fontobject&name=public/fonts/[name].[ext]' },
{
test: /[\/\\]node_modules[\/\\]some-module[\/\\]index\.js$/,
loader: "imports?this=>window"
}, {
test: /materialize-css\/bin\//,
loader: 'imports?jQuery=jquery,$=jquery,hammerjs'
}]
}
}
/*var main = {
context: __dirname + '/app',
entry: {
main: './main.js'
},
target: 'node',
output: {
path: __dirname + '/app/build',
filename: "[name].entry.js",
publicPath: 'http://localhost:8080/app/build/'
},
plugins: [
new webpackUglifyJsPlugin({
cacheFolder: path.resolve(__dirname, 'public/cached_uglify/'),
debug: true,
minimize: true,
sourceMap: false,
output: {
comments: false
},
compressor: {
warnings: false
}
})
],
module: {
loaders: []
}
}*/
module.exports = [app]