-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.ts
36 lines (35 loc) · 1.03 KB
/
webpack.config.ts
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
import * as path from "path";
import * as nodeExternals from "webpack-node-externals";
module.exports = {
mode: "production",
entry: "./src",
output: {
filename: "index.js",
path: path.resolve(__dirname, "lib"),
libraryTarget: "commonjs-module",
},
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader",
options: {
plugins: ["@babel/plugin-proposal-class-properties"],
presets: [
"@babel/preset-typescript",
"@babel/preset-react",
],
},
},
},
],
},
resolve: {
extensions: [".js", ".ts", ".tsx"],
modules: [path.resolve("./src"), path.resolve("./node_modules")],
},
externals: [nodeExternals()],
devtool: "source-map",
};