-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
61 lines (60 loc) · 1.37 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
const path = require('path');
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
target: "electron-main",
mode: "production",
entry: "./src/entry.js",
output: {
path: __dirname,
filename: "app/js/bundle.js"
},
performance: {
hints: false
},
plugins: [
new webpack.ProvidePlugin({
hljs: "hightlightjs",
markdownit: "markdownit",
CodeMirror: "codemirrorjs"
}),
],
optimization: {
minimizer: [
new UglifyJSPlugin({
uglifyOptions: {
output: {
ascii_only: true
}
}
}),
]
},
resolve: {
modules: ["node_modules"],
extensions: ['.js', '.css'],
alias: {
hightlightjs: "highlight.js/lib/highlight.js",
markdownit: "markdown-it/index.js",
codemirrorjs: "codemirror/lib/codemirror.js",
codemirrorjs_overlay: "codemirror/addon/mode/overlay.js",
codemirrorjs_javascript: "codemirror/mode/javascript/javascript.js",
codemirrorjs_gfm: "codemirror/mode/gfm/gfm.js",
codemirrorjs_markdown: "codemirror/mode/markdown/markdown.js"
}
},
module: {
rules: [
{
test: /\.js$/,
exclude: [
path.resolve('node_modules'),
],
},
{
test: /\.css$/,
use: [ 'style-loader', 'css-loader' ]
}
]
}
};