Skip to content

Commit

Permalink
feat(create-app): closer parity on preact typescript template to prea…
Browse files Browse the repository at this point in the history
…ct template (#1996)
  • Loading branch information
kerimhudson authored Feb 12, 2021
1 parent 8f830bf commit c2622de
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion packages/create-app/template-preact-ts/src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { h, Fragment } from 'preact'
import { Logo } from './logo'

export function App() {
Expand Down
2 changes: 0 additions & 2 deletions packages/create-app/template-preact-ts/src/logo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'

export const Logo = () => (
<svg
class="logo"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/template-preact-ts/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { render, h } from 'preact'
import { render } from 'preact'
import { App } from './app'
import './index.css'

Expand Down
1 change: 1 addition & 0 deletions packages/create-app/template-preact-ts/src/preact.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import JSX = preact.JSX
3 changes: 1 addition & 2 deletions packages/create-app/template-preact-ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{
"compilerOptions": {
"target": "ESNext",
Expand All @@ -15,7 +14,7 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react",
"jsx": "preserve",
"jsxFactory": "h",
"jsxFragmentFactory": "Fragment"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/create-app/template-preact-ts/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import preactRefresh from '@prefresh/vite'
export default defineConfig({
esbuild: {
jsxFactory: 'h',
jsxFragment: 'Fragment'
jsxFragment: 'Fragment',
jsxInject: `import { h, Fragment } from 'preact'`
},
plugins: [preactRefresh()]
})

0 comments on commit c2622de

Please sign in to comment.