forked from dolanmiu/docx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.ts
43 lines (38 loc) · 1.13 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
// tslint:disable:no-object-literal-type-assertion
import * as path from "path";
import { Configuration } from "webpack";
module.exports = {
entry: "./src/index.ts",
output: {
path: path.resolve("build"),
filename: "index.js",
libraryTarget: "umd",
library: "docx",
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
modules: [path.resolve("./src"), "node_modules"],
},
module: {
rules: [
{
test: /\.ts$/,
loaders: ["awesome-typescript-loader"],
},
// For coverage testing
...(process.env.NODE_ENV !== "production"
? [
{
test: /\.(ts)/,
include: path.resolve("src"),
loader: "istanbul-instrumenter-loader",
enforce: "post",
exclude: [/node_modules/],
},
]
: []),
],
},
// Because docx is now targetting web
// target: 'node',
} as Configuration;