-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathwebpack.config.js
56 lines (55 loc) · 1.73 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
const path = require('path');
var nodeExternals = require('webpack-node-externals');
module.exports = {
mode: 'production',
entry: path.resolve('./src/index.ts'),
output: {
path: path.resolve('./'),
filename: 'index.js',
},
resolve: {
extensions: ['.ts', '.js', '.json'],
mainFields : ['main']
},
externals: [nodeExternals({
whitelist: [/@quarkjs.+/, 'lodash', 'universal-analytics']
})],
module: {
rules: [
{
test: /\.(js|jsx|ts|tsx)$/,
exclude: (file) => (
/node_modules/.test(file) &&
!/\.vue\.js/.test(file)
),
use: {
loader: "babel-loader",
options: {
"presets": [
[
("@babel/preset-env"), {
"targets": {
"chrome": "69"
}
}
],
[("@babel/preset-typescript"), {
isTSX: false,
allExtensions: true
}],
],
"plugins": [
("@babel/plugin-proposal-class-properties"),
("@babel/plugin-proposal-object-rest-spread"),
("@babel/plugin-syntax-dynamic-import")
]
}
}
}
]
},
target: 'electron-main',
node: {
__dirname: false
}
}