-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adding ssrFormat flag to overwrite default output format
- Loading branch information
1 parent
2957123
commit a102b11
Showing
5 changed files
with
64 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "test-esm-ssr", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"build": "vite build --ssr src/App.jsx" | ||
}, | ||
"dependencies": { | ||
"preact": "^10.5.13", | ||
"preact-render-to-string": "^5.1.19" | ||
}, | ||
"devDependencies": { | ||
"@preact/preset-vite": "2.0.1", | ||
"vite": "^2.2.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { render } from 'preact-render-to-string'; | ||
|
||
export function App() { | ||
return ( | ||
<> | ||
<p>Hello Vite + Preact!</p> | ||
<p> | ||
<a | ||
class="link" | ||
href="https://preactjs.com/" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Learn Preact | ||
</a> | ||
</p> | ||
</> | ||
) | ||
} | ||
|
||
export async function prerender() { | ||
return await render(<App />); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { defineConfig } from 'vite' | ||
import preact from '@preact/preset-vite' | ||
|
||
export default defineConfig({ | ||
plugins: [preact.default()] | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters