Skip to content

Commit

Permalink
Updated sveltekit example
Browse files Browse the repository at this point in the history
  • Loading branch information
Neo-Ciber94 committed Oct 5, 2023
1 parent aad3589 commit 41275a9
Show file tree
Hide file tree
Showing 4 changed files with 582 additions and 27 deletions.
2 changes: 2 additions & 0 deletions examples/sveltekit-mal-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/adapter-cloudflare": "^2.3.3",
"@sveltejs/kit": "^1.20.4",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
Expand All @@ -35,6 +36,7 @@
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^4.4.2",
"vite-plugin-node-polyfills": "^0.15.0",
"vitest": "^0.34.0"
},
"type": "module"
Expand Down
11 changes: 9 additions & 2 deletions examples/sveltekit-mal-auth/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import adapter from '@sveltejs/adapter-auto';
// import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/kit/vite';
import adapter from '@sveltejs/adapter-cloudflare';

/** @type {import('@sveltejs/kit').Config} */
const config = {
Expand All @@ -11,7 +12,13 @@ const config = {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter()
adapter: adapter({
// See below for an explanation of these options
routes: {
include: ['/*'],
exclude: ['<all>']
}
})
}
};

Expand Down
9 changes: 7 additions & 2 deletions examples/sveltekit-mal-auth/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import dotenv from 'dotenv';
dotenv.config();

Expand All @@ -15,12 +16,16 @@ const defineProcessEnv = () => {
};

export default defineConfig({
plugins: [sveltekit()],
plugins: [sveltekit(), nodePolyfills()],
server: {
port: 3000
},
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
},
define: defineProcessEnv(),
//define: defineProcessEnv()
define: {
'process.versions': JSON.stringify(process.versions),
...defineProcessEnv()
}
});
Loading

0 comments on commit 41275a9

Please sign in to comment.