From b22f565dd00652dd051947d83a420264b076aba0 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Wed, 16 Jan 2019 13:34:32 +0000 Subject: [PATCH 1/2] Use a typescript webpack config --- tsconfig.json | 3 ++- webpack.config.js => webpack.config.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) rename webpack.config.js => webpack.config.ts (94%) diff --git a/tsconfig.json b/tsconfig.json index 59d86f2400..a2d4c199ef 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,7 +23,8 @@ "tests", "**/_*", "demo", - "scripts" + "scripts", + "webpack.config.ts" ], "typedocOptions": { "mode": "file", diff --git a/webpack.config.js b/webpack.config.ts similarity index 94% rename from webpack.config.js rename to webpack.config.ts index 40ec0b0d23..ce1455ac50 100644 --- a/webpack.config.js +++ b/webpack.config.ts @@ -1,4 +1,4 @@ -const path = require("path"); +import * as path from "path"; module.exports = { entry: "./src/index.ts", @@ -27,7 +27,7 @@ module.exports = { loader: "istanbul-instrumenter-loader", enforce: "post", exclude: [/node_modules/], - } + }, ], }, From 40730548bb958c66e1440b993ff9ebe5a050d579 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 23 Jan 2019 20:09:32 +0000 Subject: [PATCH 2/2] Add webpack type definitions --- package.json | 1 + webpack.config.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 57ab21b8ff..36701f7ea2 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "@types/mocha": "^2.2.39", "@types/request-promise": "^4.1.42", "@types/sinon": "^4.3.1", + "@types/webpack": "^4.4.24", "awesome-typescript-loader": "^3.4.1", "chai": "^3.5.0", "glob": "^7.1.2", diff --git a/webpack.config.ts b/webpack.config.ts index ce1455ac50..e048202003 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -1,4 +1,6 @@ +// tslint:disable:no-object-literal-type-assertion import * as path from "path"; +import { Configuration } from "webpack"; module.exports = { entry: "./src/index.ts", @@ -33,4 +35,4 @@ module.exports = { // Because docx is now targetting web // target: 'node', -}; +} as Configuration;