Skip to content

Commit 96fc0f3

Browse files
authored
refactor: Make TS a peer dep (#1798)
* refactor: Makes TS an optional peer dependency * docs: Adding changeset
1 parent 73232fd commit 96fc0f3

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

.changeset/empty-experts-float.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'preact-cli': minor
3+
---
4+
5+
TypeScript is now an optional peer dependency, rather than a direct dependency, of `preact-cli`.
6+
7+
If you use TypeScript in your projects (`.ts` or `.tsx`), you will need to have your own version of TypeScript installed and added to your `package.json`. This gives you greator control over the version of TypeScript used and most already have TypeScript listed as a dependency anyways.
8+
9+
For those not using TypeScript, no change is needed, and this should make your `node_modules` directory a bit smaller (~20% w/ barebones dependency list).

packages/cli/package.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
"stack-trace": "0.0.10",
9797
"style-loader": "^2.0.0",
9898
"terser-webpack-plugin": "^4.2.3",
99-
"typescript": "~4.6.4",
10099
"update-notifier": "^5.1.0",
101100
"url-loader": "^4.1.1",
102101
"validate-npm-package-name": "^4.0.0",
@@ -133,14 +132,16 @@
133132
"shelljs": "^0.8.3",
134133
"sirv": "^1.0.11",
135134
"stylus": "^0.54.8",
136-
"stylus-loader": "^4.3.3"
135+
"stylus-loader": "^4.3.3",
136+
"typescript": "~4.6.4"
137137
},
138138
"peerDependencies": {
139139
"less-loader": "^7.3.0",
140140
"preact": "*",
141141
"preact-render-to-string": "*",
142142
"sass-loader": "^10.2.0",
143-
"stylus-loader": "^4.3.3"
143+
"stylus-loader": "^4.3.3",
144+
"typescript": "^4.6.4"
144145
},
145146
"peerDependenciesMeta": {
146147
"less-loader": {
@@ -151,6 +152,9 @@
151152
},
152153
"stylus-loader": {
153154
"optional": true
155+
},
156+
"typescript": {
157+
"optional": true
154158
}
155159
},
156160
"engines": {

0 commit comments

Comments
 (0)