-
Notifications
You must be signed in to change notification settings - Fork 96
New: Blank Typescript template #165
New: Blank Typescript template #165
Conversation
617beea
to
7414ebd
Compare
This looks good, but I must confess I have not looked fully into how snowpack deals with TS. No actual TypeScript dependency, just type stripping with Babel or similar? Maybe the production version should go through the actual compiler? FYI The creators are finalizing the new official |
declare module '*.webp' { | ||
const ref: string; | ||
export default ref; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Good additions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! This is awesome.
Snowpack doesn’t really need to run the compiler because when it searches your code for imports & exports, that’s literally all it cares about. For that, we run es-module-lexer which is a tiny, WASM-powered lexer that lets us grab all that quickly and cheaply, and it works for TS. If we included the TS compiler (which is heavy & slow), we’d slow down |
@drwpow Hmmm, looking at the react-typescript and litelement-typescript templates both utilize |
We do use |
Oh good catch. I hadn’t noticed for both that was in the
Yup! That too. Forgot we use that for building 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally and works well for me! Ready to merge it whenever (I don’t remember if you can merge on this repo or not)
@stramel esbuild looks very cool. How do I turn on the minifier feature in Snowpack? I searched the docs and found:
but that was the final mention of minification? Seems like with esbuild it is dependency free and built in out of the box? |
There's a reasonable argument for moving the majority of that tsconfig into https://github.com/tsconfig/bases too as it's mostly framework-y level stuff 👍 ( though I'm not sure how much this template relies on npm ) |
I can't use it yet as it is not published, but it shows on https://github.com/pikapkg/create-snowpack-app as available:
|
@David-Else it hasn't been published to npm yet. |
Resolves #157
Summary:
Adds a blank typescript template for snowpack. I also sync'd the types across all 3 typescript templates.