-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.ts
44 lines (41 loc) · 989 Bytes
/
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
37
38
39
40
41
42
43
import { Configuration } from "webpack";
import BundleDeclarationsWebpackPlugin from "bundle-declarations-webpack-plugin";
const config : Configuration = {
experiments: {
outputModule: true
},
mode: "production",
entry: "./src/index.ts",
output: {
path: __dirname + '/dist',
filename: 'index.js',
chunkFormat: 'module',
library: {
type: "module"
},
environment: {
module: true,
},
},
resolve: {
extensions: ['.ts', '.js', '.tsx', '.jsx'],
},
externalsType: "module",
externals: ["react"],
module: {
rules: [
{
test: /\.ts/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
plugins: [
new BundleDeclarationsWebpackPlugin({
entry: "./src/index.ts",
outFile: "index.d.ts"
})
]
}
export default config;