Skip to content

Commit a2fa77f

Browse files
feat: added types
1 parent f0b1f59 commit a2fa77f

23 files changed

+1284
-212
lines changed

package-lock.json

+155
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+11-3
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,28 @@
77
"author": "Tobias Koppers @sokra",
88
"homepage": "https://github.com/webpack/webpack-dev-middleware",
99
"bugs": "https://github.com/webpack/webpack-dev-middleware/issues",
10-
"main": "dist/cjs.js",
1110
"funding": {
1211
"type": "opencollective",
1312
"url": "https://opencollective.com/webpack"
1413
},
14+
"main": "dist/cjs.js",
15+
"types": "types/cjs.d.ts",
1516
"engines": {
1617
"node": ">= 12.13.0"
1718
},
1819
"scripts": {
1920
"commitlint": "commitlint --from=master",
2021
"fmt:check": "prettier \"{**/*,*}.{js,json,md,yml,css}\" --list-different",
2122
"lint:js": "eslint --cache src test",
23+
"lint:types": "tsc --pretty --noEmit",
2224
"lint": "npm-run-all lint:js fmt:check",
2325
"fmt": "npm run fmt:check -- --write",
2426
"fix:js": "npm run lint:js -- --fix",
2527
"fix": "npm-run-all fix:js fmt",
2628
"prepare": "husky install && npm run build",
27-
"build": "del dist && babel src -d dist --copy-files",
29+
"build:types": "tsc --declaration --emitDeclarationOnly --outDir types && prettier \"types/**/*.ts\" --write",
30+
"build:code": "cross-env NODE_ENV=production babel src -d dist --copy-files",
31+
"build": "npm-run-all -p \"build:**\"",
2832
"release": "standard-version",
2933
"security": "npm audit --production",
3034
"test:only": "cross-env NODE_ENV=test jest",
@@ -34,7 +38,8 @@
3438
"test": "npm run test:coverage"
3539
},
3640
"files": [
37-
"dist"
41+
"dist",
42+
"types"
3843
],
3944
"peerDependencies": {
4045
"webpack": "^4.0.0 || ^5.0.0"
@@ -52,6 +57,9 @@
5257
"@babel/preset-env": "^7.14.7",
5358
"@commitlint/cli": "^15.0.0",
5459
"@commitlint/config-conventional": "^15.0.0",
60+
"@types/connect": "^3.4.35",
61+
"@types/express": "^4.17.13",
62+
"@types/mime-types": "^2.1.1",
5563
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
5664
"babel-jest": "^27.0.6",
5765
"chokidar": "^3.5.1",

0 commit comments

Comments
 (0)