-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update examples to use import.meta.dirname (Node v21.2+)
- Loading branch information
Showing
28 changed files
with
164 additions
and
229 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import test from 'node:test' | ||
import { join, resolve, dirname } from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
import { makeSSRBuildTest, makeIndexTest } from '../test-factories.mjs' | ||
import { main } from './server.js' | ||
|
||
const cwd = dirname(fileURLToPath(import.meta.url)) | ||
const cwd = import.meta.dirname | ||
|
||
test('render index page in development', makeIndexTest({ main, dev: true })) | ||
test('build production bundle', makeSSRBuildTest({ cwd })) | ||
test('render index page in production', makeIndexTest({ main })) | ||
test('react-next', async (t) => { | ||
await t.test('render index page in development', makeIndexTest({ main, dev: true })) | ||
await t.test('build production bundle', makeSSRBuildTest({ cwd })) | ||
await t.test('render index page in production', makeIndexTest({ main })) | ||
}) |
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 |
---|---|---|
@@ -1,17 +1,11 @@ | ||
import { resolve, dirname } from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import { viteFastify } from "@fastify/vite/plugin"; | ||
import viteReact from "@vitejs/plugin-react"; | ||
|
||
const path = fileURLToPath(import.meta.url); | ||
const root = resolve(dirname(path), "client"); | ||
|
||
const plugins = [viteFastify(), viteReact({ jsxRuntime: "classic" })]; | ||
import { join } from 'node:path' | ||
import viteFastify from '@fastify/vite/plugin' | ||
import viteReact from '@vitejs/plugin-react' | ||
|
||
export default { | ||
root, | ||
plugins, | ||
server: { | ||
hmr: !!process.env.TEST, | ||
}, | ||
}; | ||
root: join(importa.meta.dirname, 'client'), | ||
plugins: [ | ||
viteFastify(), | ||
viteReact({ jsxRuntime: "classic" }) | ||
], | ||
} |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import test from 'node:test' | ||
import { join, resolve, dirname } from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
import { makeSSRBuildTest, makeIndexTest } from '../test-factories.mjs' | ||
import { main } from './server.js' | ||
|
||
const cwd = dirname(fileURLToPath(import.meta.url)) | ||
const cwd = import.meta.dirname | ||
|
||
test('render index page in development', makeIndexTest({ main, dev: true })) | ||
test('build production bundle', makeSSRBuildTest({ cwd })) | ||
test('render index page in production', makeIndexTest({ main })) | ||
test('react-streaming', async (t) => { | ||
await t.test('render index page in development', makeIndexTest({ main, dev: true })) | ||
await t.test('build production bundle', makeSSRBuildTest({ cwd })) | ||
await t.test('render index page in production', makeIndexTest({ main })) | ||
}) |
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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
import { resolve, dirname } from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import { viteFastify } from "@fastify/vite/plugin"; | ||
import viteReact from "@vitejs/plugin-react"; | ||
|
||
const path = fileURLToPath(import.meta.url); | ||
const root = resolve(dirname(path), "client"); | ||
|
||
const plugins = [viteFastify(), viteReact({ jsxRuntime: "classic" })]; | ||
import { join } from 'node:path' | ||
import viteFastify from '@fastify/vite/plugin' | ||
import viteReact from '@vitejs/plugin-react' | ||
|
||
export default { | ||
root, | ||
plugins, | ||
}; | ||
root: join(importa.meta.dirname, 'client'), | ||
plugins: [ | ||
viteFastify(), | ||
viteReact({ jsxRuntime: 'classic' }) | ||
], | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
import { resolve, dirname } from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import { viteFastify } from "@fastify/vite/plugin"; | ||
import viteReact from "@vitejs/plugin-react"; | ||
|
||
const path = fileURLToPath(import.meta.url); | ||
const root = resolve(dirname(path), "client"); | ||
|
||
const plugins = [viteFastify(), viteReact({ jsxRuntime: "classic" })]; | ||
import { join } from 'node:path' | ||
import viteFastify from '@fastify/vite/plugin' | ||
import viteReact from '@vitejs/plugin-react' | ||
|
||
export default { | ||
root, | ||
plugins, | ||
}; | ||
root: join(importa.meta.dirname, 'client'), | ||
plugins: [ | ||
viteFastify(), | ||
viteReact({ jsxRuntime: "classic" }) | ||
], | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
import { resolve, dirname } from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import { viteFastify } from "@fastify/vite/plugin"; | ||
import viteReact from "@vitejs/plugin-react"; | ||
|
||
const path = fileURLToPath(import.meta.url); | ||
const root = resolve(dirname(path), "client"); | ||
|
||
const plugins = [viteFastify(), viteReact({ jsxRuntime: "classic" })]; | ||
import { join } from 'node:path' | ||
import viteFastify from '@fastify/vite/plugin' | ||
import viteReact from '@vitejs/plugin-react' | ||
|
||
export default { | ||
root, | ||
plugins, | ||
}; | ||
root: join(importa.meta.dirname, 'client'), | ||
plugins: [ | ||
viteFastify(), | ||
viteReact({ jsxRuntime: 'classic' }) | ||
], | ||
} |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import test from 'node:test' | ||
import { join, resolve, dirname } from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
import { makeSSRBuildTest, makeIndexTest } from '../test-factories.mjs' | ||
import { main } from './server.js' | ||
|
||
const cwd = dirname(fileURLToPath(import.meta.url)) | ||
const cwd = import.meta.dirname | ||
|
||
test('render index page in development', makeIndexTest({ main, dev: true })) | ||
test('build production bundle', makeSSRBuildTest({ cwd })) | ||
test('render index page in production', makeIndexTest({ main })) | ||
test('solid-hydration', async (t) => { | ||
await t.test('render index page in development', makeIndexTest({ main, dev: true })) | ||
await t.test('build production bundle', makeSSRBuildTest({ cwd })) | ||
await t.test('render index page in production', makeIndexTest({ main })) | ||
}) |
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 |
---|---|---|
@@ -1,19 +1,14 @@ | ||
import { resolve, dirname } from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import { viteFastify } from "@fastify/vite/plugin"; | ||
import viteSolid from "vite-plugin-solid"; | ||
|
||
const path = fileURLToPath(import.meta.url); | ||
const root = resolve(dirname(path), "client"); | ||
|
||
const plugins = [viteFastify(), viteSolid({ ssr: true })]; | ||
|
||
const ssr = { | ||
noExternal: ["@solidjs/router"], | ||
}; | ||
import { join } from 'node:path' | ||
import viteFastify from '@fastify/vite/plugin' | ||
import viteSolid from 'vite-plugin-solid' | ||
|
||
export default { | ||
root, | ||
plugins, | ||
ssr, | ||
}; | ||
root: join(import.meta.dirname, 'client'), | ||
plugins: [ | ||
viteFastify(), | ||
viteSolid({ ssr: true }) | ||
], | ||
ssr: { | ||
noExternal: ['@solidjs/router'], | ||
}, | ||
} |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import test from 'node:test' | ||
import { join, resolve, dirname } from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
import { makeSSRBuildTest, makeIndexTest } from '../test-factories.mjs' | ||
import { main } from './server.js' | ||
|
||
const cwd = dirname(fileURLToPath(import.meta.url)) | ||
const cwd = import.meta.dirname | ||
|
||
test('render index page in development', makeIndexTest({ main, dev: true })) | ||
test('build production bundle', makeSSRBuildTest({ cwd })) | ||
test('render index page in production', makeIndexTest({ main })) | ||
test('solid-vanilla', async (t) => { | ||
await t.test('render index page in development', makeIndexTest({ main, dev: true })) | ||
await t.test('build production bundle', makeSSRBuildTest({ cwd })) | ||
await t.test('render index page in production', makeIndexTest({ main })) | ||
}) |
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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
import { resolve, dirname } from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import { viteFastify } from "@fastify/vite/plugin"; | ||
import viteSolid from "vite-plugin-solid"; | ||
|
||
const path = fileURLToPath(import.meta.url); | ||
const root = resolve(dirname(path), "client"); | ||
|
||
const plugins = [viteFastify(), viteSolid({ ssr: true })]; | ||
import { join } from 'node:path' | ||
import viteFastify from '@fastify/vite/plugin' | ||
import viteSolid from 'vite-plugin-solid' | ||
|
||
export default { | ||
root, | ||
plugins, | ||
}; | ||
root: join(import.meta.dirname, 'client'), | ||
plugins: [ | ||
viteFastify(), | ||
viteSolid({ ssr: true }) | ||
], | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
import { resolve, dirname } from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import { viteFastify } from "@fastify/vite/plugin"; | ||
import { svelte as viteSvelte } from "@sveltejs/vite-plugin-svelte"; | ||
|
||
const path = fileURLToPath(import.meta.url); | ||
const root = resolve(dirname(path), "client"); | ||
|
||
const plugins = [ | ||
viteFastify(), | ||
viteSvelte({ | ||
compilerOptions: { | ||
hydratable: true, | ||
}, | ||
}), | ||
]; | ||
import { join } from 'node:path' | ||
import viteFastify from '@fastify/vite/plugin' | ||
import { svelte as viteSvelte } from '@sveltejs/vite-plugin-svelte' | ||
|
||
export default { | ||
root, | ||
plugins, | ||
}; | ||
root: join(import.meta.dirname, 'client'), | ||
plugins: [ | ||
viteFastify(), | ||
viteSvelte({ | ||
compilerOptions: { | ||
hydratable: true, | ||
}, | ||
}), | ||
], | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
import { resolve, dirname } from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import { viteFastify } from "@fastify/vite/plugin"; | ||
import { svelte as viteSvelte } from "@sveltejs/vite-plugin-svelte"; | ||
|
||
const path = fileURLToPath(import.meta.url); | ||
const root = resolve(dirname(path), "client"); | ||
|
||
const plugins = [viteFastify(), viteSvelte()]; | ||
import { join } from 'node:path' | ||
import viteFastify from '@fastify/vite/plugin' | ||
import { svelte as viteSvelte } from '@sveltejs/vite-plugin-svelte' | ||
|
||
export default { | ||
root, | ||
plugins, | ||
}; | ||
root: join(import.meta.dirname, 'client'), | ||
plugins: [ | ||
viteFastify(), | ||
viteSvelte() | ||
], | ||
} |
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 |
---|---|---|
@@ -1,13 +1,15 @@ | ||
import { resolve } from "node:path"; | ||
import { viteFastify } from "@fastify/vite/plugin"; | ||
import viteReact from "@vitejs/plugin-react"; | ||
import { join } from 'node:path' | ||
import { viteFastify } from '@fastify/vite/plugin' | ||
import viteReact from '@vitejs/plugin-react' | ||
|
||
/** @type {import('vite').UserConfig} */ | ||
export default { | ||
root: resolve(import.meta.dirname, "src/client"), | ||
plugins: [viteReact(), viteFastify()], | ||
root: join(import.meta.dirname, 'src/client'), | ||
plugins: [ | ||
viteReact(), | ||
viteFastify() | ||
], | ||
build: { | ||
emptyOutDir: true, | ||
outDir: resolve(import.meta.dirname, "dist/client"), | ||
outDir: join(import.meta.dirname, 'dist/client'), | ||
}, | ||
}; |
Oops, something went wrong.