Skip to content

Commit

Permalink
add <!DOCTYPE html> to templates
Browse files Browse the repository at this point in the history
  • Loading branch information
uenoB committed Aug 6, 2024
1 parent f238c07 commit 4807152
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 8 deletions.
3 changes: 3 additions & 0 deletions template/mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"private": true,
"type": "module",
"engines": {
"node": ">=18"
},
"scripts": {
"dev": "vite",
"build": "vite build",
Expand Down
2 changes: 1 addition & 1 deletion template/mdx/src/index.html.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const main = ({ moduleName }) =>
<md.default components={{ a }} />
</Root>
)
return { default: render(root) }
return { default: new Blob(['<!DOCTYPE html>', await render(root)]) }
}
return [relPath, { main }]
})
3 changes: 3 additions & 0 deletions template/page/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"private": true,
"type": "module",
"engines": {
"node": ">=18"
},
"scripts": {
"dev": "vite",
"build": "vite build",
Expand Down
2 changes: 1 addition & 1 deletion template/page/src/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export class Page extends PageClass {
</Root>
</Suspense>
)
return await render(html)
return new Blob(['<!DOCTYPE html>', await render(html)])
}
}
5 changes: 4 additions & 1 deletion template/react/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import minissgReact from '@minissg/render-react'
export default defineConfig({
build: {
rollupOptions: {
input: ['./src/index.html.jsx?render', './src/browser.html.jsx?render']
input: [
'./src/index.html.jsx?render&doctype',
'./src/browser.html.jsx?render&doctype'
]
}
},
plugins: [
Expand Down
5 changes: 4 additions & 1 deletion template/solid/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import minissgSolid from '@minissg/render-solid'
export default defineConfig({
build: {
rollupOptions: {
input: ['./src/index.html.jsx?render', './src/browser.html.jsx?render']
input: [
'./src/index.html.jsx?render&doctype',
'./src/browser.html.jsx?render&doctype'
]
}
},
plugins: [
Expand Down
4 changes: 2 additions & 2 deletions template/svelte/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export default defineConfig({
build: {
rollupOptions: {
input: [
'./src/index.html.svelte?render',
'./src/browser.html.svelte?render'
'./src/index.html.svelte?render&doctype',
'./src/browser.html.svelte?render&doctype'
]
}
},
Expand Down
4 changes: 2 additions & 2 deletions template/vue/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default defineConfig({
minify: true,
rollupOptions: {
input: {
'index.html': './src/index-html.vue?render',
'browser.html': './src/browser-html.vue?render'
'index.html': './src/index-html.vue?render&doctype',
'browser.html': './src/browser-html.vue?render&doctype'
}
}
},
Expand Down

0 comments on commit 4807152

Please sign in to comment.