-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
55 lines (50 loc) · 1.47 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
var path = require("path");
var fs = require("fs");
var config = {
mode: 'production',
target: 'electron-main',
// devtool: 'source-map',
/*
* index.tsx represents the entry point to your web application. Webpack will
* recursively go through every "require" statement in index.tsx and
* efficiently build out the application's dependency tree.
*/
entry: './src/main/index.ts',
/*
* The combination of path and filename tells Webpack what name to give to
* the final bundled JavaScript file and where to store this file.
*/
node: {
__dirname: false, //make sure __dirname does not get mocked by webpack
__filename: false
},
output: {
path: path.resolve(__dirname, "output"),
filename: 'index.js',
publicPath: "/output/"
},
/*
* resolve lets Webpack now in advance what file extensions you plan on
* "require"ing into the web application, and allows you to drop them
* in your code.
*/
resolve: {
extensions: [".ts", ".tsx", ".js", '.jsx', ".json"/* , "scss" */]
},
module: {
/*
* Each loader needs an associated Regex test that goes through each
* of the files you've included (or in this case, all files but the
* ones in the excluded directories) and finds all files that pass
* the test. Then it will apply the loader to that file.
*/
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
]
}
};
module.exports = config;