forked from dolanmiu/docx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.ts
46 lines (39 loc) · 1.01 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
37
38
39
40
41
42
43
44
45
46
import * as path from "path";
import { Configuration, ProvidePlugin } from "webpack";
const configuration: Configuration = {
mode: "production",
entry: "./src/index.ts",
output: {
path: path.resolve("build"),
filename: "index.js",
libraryTarget: "umd",
library: "docx",
globalObject: "this",
},
resolve: {
extensions: [".ts", ".js"],
modules: [path.resolve("./src"), "node_modules"],
fallback: {
buffer: require.resolve("buffer"),
stream: require.resolve("stream-browserify"),
},
},
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader",
options: {
configFile: "tsconfig.json",
},
},
],
},
plugins: [
// fix "process is not defined" error
new ProvidePlugin({
process: "process/browser",
}),
],
};
module.exports = configuration;