-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
42 lines (40 loc) · 979 Bytes
/
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
const path = require("path");
// const ForkIsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin"); // not recemoneded for all time
module.exports = {
// Generate source map
devtool: "source-map",
// Bundling mode
mode: "production",
// Entry files location
entry: "./src/index.ts",
// Output bundle location
output: {
path: path.resolve(__dirname, "dist"),
filename: "main.js",
},
// File resolution
resolve: {
extensions: [".ts", ".js"],
},
// Loaders
module: {
// rules: [{ test: /\.ts?$/, use: "ts-loader", exclude: /node_modules/ }],
rules: [
{
test: /\.ts?$/,
use: {
loader: "ts-loader",
options: {
transpileOnly: true,
},
},
exclude: /node_modules/,
},
],
},
// Plugins
// Run TSC in a seperate thread. but not recemoneded for all time
// plugins: [new ForkIsCheckerWebpackPlugin()],
// Watch
watch: true,
};