Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Closer parity to Preact template on Preact Typescript template. #1996

Merged
merged 1 commit into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()]
})