wub / preact-cli-plugin-typescript

Adds TypeScript support to preact-cli :zap:
MIT License
49 stars 6 forks source link

Should it be not in dependencies? #10

Closed kono-paku closed 5 years ago

kono-paku commented 5 years ago

Hi! I have checked out how to install the package. It looks like installing in devDependencies of package.json like below.

npm i preact-cli-plugin-typescript --save-dev

Does type check by using typescript does not occur in production? I thought it ought to be supported in run-time as well.

wub commented 5 years ago

Hey @kono-paku, this plugin, and TypeScript, are only needed at build time - it gets turned into plain JavaScript, and any TypeScript-detectable errors will be caught when it builds.

I would recommend against compiling TypeScript in the browser!

kono-paku commented 5 years ago

@wub Thank you for answering the question! Although Typescript is needed for the build time, now I am wondering it is also required for the production build time. Is there something I am misunderstanding?

wub commented 5 years ago

@kono-paku No problem! The "devDependencies" are also used when doing a "production" build. "dependencies" are only used for runtime, as in, things the browser/Node would use.

kono-paku commented 5 years ago

@wub Thanks Jarrod for fix my poor comprehension!