-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
38 lines (36 loc) · 1.09 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
"use strict"
const path = require("path")
const { CleanWebpackPlugin } = require("clean-webpack-plugin")
const nodeExternals = require("webpack-node-externals")
module.exports = {
mode: "development",
entry: {
bundle: path.resolve(__dirname, "src/app.ts"),
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name].js",
},
target: "node",
devtool: false,
module: {
rules: [
{
// Compiling TypeScript with .ts extension
test: /\.ts$/,
use: "ts-loader",
},
{
test: /\.js$/,
loader: "webpack-remove-debug", // remove "debug" package
},
],
},
resolve: {
// To resolve the .ts and js file in the import statement
extensions: [".ts", ".js"],
},
externals: [nodeExternals()], // in order to ignore all modules in node_modules folder
externalsPresets: { node: true }, // in order to ignore built-in modules like path, fs, etc.
plugins: [new CleanWebpackPlugin()],
}