Closed huangang closed 1 year ago
I just hit this issue too. I'm not sure having typescript
in production dependencies is a good idea though.
The whole new Type Safety feature should be moved to another npm package for it to be loaded only in dev environment. Then typescript could stay in devDependencies
.
@Toilal when NODE_ENV
is set to production
the package disables typescript generation features. So this is kind of already taken care of. It would be better to move it to a separate package indeed but this is not something I'm going to put an effort in right now. Feel free to create a PR however.
when
NODE_ENV
is set toproduction
the package disables typescript generation features. So this is kind of already taken care of.
There is no requirement to set this ENV variable in order to run the app in production, sometimes people have different NODE_ENV values for different environments of their app like preproduction
.
So it's not a solution...
Problem is that typescript is most often placed in devDependencies
and unavailable in distrubution, but will still be required by util.js
.
util.js
should at least use a dynamic import to support case where typescript
is not available and avoid the whole application to crash.
If you are OK with this, I can write a pull request.
typescript
should be moved todependencies
, becausesrc/utils/util.ts
uses it