英文:
need help setting a simple typescript preact app
问题
我是新手preact,我尝试在preact中使用typescript设置一个简单的应用。他们的默认和typescript模板包含不必要的东西,如jest和testing,我不需要。他们有另一个名为"simple"的模板,但只有js版本。
有没有办法在preact的"simple"模板中添加typescript?
我的目标是获得类似于preact的"simple"模板,但具有typescript和scss。
英文:
I am new to preact and I am trying to a setup a simple app with typescript in preact. Their default and typescript templates contain unnecessary things like jest and testing which I don't need. They have another template called "simple" but that only comes in js.
Is there any way to add typescript to the simple template of preact?
My goal is to get a template similar to the preact "simple" template with typescript and scss.
答案1
得分: 1
Full disclosure, I'm a maintainer of Preact-CLI and those templates.
You can simply switch .js
files to .ts
in the simple template and have TypeScript support, nothing else is needed. However, I'd caution against that route as the simple template is missing key fundamentals like file system-based code splitting, routing, some direction on how to handle assets, etc.
I'd recommend instead to simply remove the things from the TS template that you don't want. Remove jest
(and associated packages) from the package.json
if you don't want them.
英文:
Full disclosure, I'm a maintainer of Preact-CLI and those templates.
You can simply switch .js
files to .ts
in the simple template and have TypeScript support, nothing else is needed. However, I'd caution against that route as the simple template is missing key fundamentals like file system-based code splitting, routing, some direction on how to handle assets, etc.
I'd recommend instead to simply remove the things from the TS template that you don't want. Remove jest
(and associated packages) from the package.json
if you don't want them.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论