Files
docx-js/webpack.config.ts

44 lines
1.1 KiB
TypeScript
Raw Normal View History

2019-01-23 20:09:32 +00:00
// tslint:disable:no-object-literal-type-assertion
2019-01-16 13:34:32 +00:00
import * as path from "path";
2019-01-23 20:09:32 +00:00
import { Configuration } from "webpack";
2017-12-22 16:49:25 +00:00
module.exports = {
2018-08-15 01:38:00 +01:00
entry: "./src/index.ts",
2017-12-22 16:49:25 +00:00
output: {
2018-08-15 01:38:00 +01:00
path: path.resolve("build"),
filename: "index.js",
libraryTarget: "umd",
library: "docx",
2017-12-22 16:49:25 +00:00
},
resolve: {
2018-08-15 01:38:00 +01:00
extensions: [".tsx", ".ts", ".js"],
modules: [path.resolve("./src"), "node_modules"],
2017-12-22 16:49:25 +00:00
},
module: {
rules: [
{
test: /\.ts$/,
loaders: ["awesome-typescript-loader"],
2018-08-15 01:38:00 +01:00
},
2019-02-08 12:04:17 +00:00
// For coverage testing
...(process.env.NODE_ENV !== "production"
? [
{
test: /\.(ts)/,
include: path.resolve("src"),
loader: "istanbul-instrumenter-loader",
enforce: "post",
exclude: [/node_modules/],
},
]
: []),
],
2017-12-22 16:49:25 +00:00
},
2018-08-15 01:38:00 +01:00
// Because docx is now targetting web
// target: 'node',
2019-01-23 20:09:32 +00:00
} as Configuration;