forked from Rookout/explorook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.index-worker.config.js
47 lines (44 loc) · 1.01 KB
/
webpack.index-worker.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
const path = require('path');
const config = {
mode: 'development',
entry: './src/index-worker.ts',
target: "electron-renderer",
devtool: 'source-map',
node: {
__dirname: false,
__filename: false
},
module: {
rules: [
{
test: /\.ts?$/,
use: 'ts-loader',
exclude: /node_modules/
},
{
// fix https://github.com/ashtuchkin/iconv-lite/issues/204
test: /node_modules[\/\\](iconv-lite)[\/\\].+/,
resolve: {
aliasFields: ['main']
}
},
// Solves a graphql-tools related issue: https://github.com/ardatan/graphql-tools/issues/3325
{
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
}
]
},
resolve: {
extensions: ['.mjs', '.ts', '.json', '.js', '.gql', '.graphql']
},
output: {
filename: 'index-worker.js',
path: path.resolve(__dirname, 'dist')
}
};
if (!process.env.development) {
config.mode = "production";
}
module.exports = config;