Skip to content

Commit

Permalink
Merge pull request #666 from elcharitas/fix/require-issues
Browse files Browse the repository at this point in the history
fix: require not working in `svelte-kit` example
  • Loading branch information
anubra266 committed May 29, 2023
2 parents c382b08 + b629366 commit aaa733e
Show file tree
Hide file tree
Showing 6 changed files with 307 additions and 32 deletions.
1 change: 1 addition & 0 deletions examples/svelte-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"@zag-js/visually-hidden": "workspace:*"
},
"devDependencies": {
"@originjs/vite-plugin-commonjs": "^1.0.3",
"@sveltejs/adapter-auto": "^2.0.1",
"@sveltejs/kit": "^1.16.3",
"@sveltejs/package": "^2.0.2",
Expand Down
5 changes: 2 additions & 3 deletions examples/svelte-kit/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<script>
import { page } from '$app/stores';
// The country-list package used in shared prevents us from using the zag-shared package, because it uses require, and sveltekit has issues with that
import '../../../../shared/src/style.css';
import { routesData } from '../../../../shared/src/routes';
import '@zag-js/shared/src/style.css';
import { routesData } from '@zag-js/shared/src/routes';
import { dataAttr } from '@zag-js/dom-query';
const routes = routesData.sort((a, b) => a.label.localeCompare(b.label));
Expand Down
2 changes: 1 addition & 1 deletion examples/svelte-kit/src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { routesData } from '../../../../shared/src/routes';
import { routesData } from '@zag-js/shared/src/routes';
const routes = routesData.sort((a, b) => a.label.localeCompare(b.label));
</script>
Expand Down
8 changes: 7 additions & 1 deletion examples/svelte-kit/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import { sveltekit } from "@sveltejs/kit/vite"
import { viteCommonjs } from "@originjs/vite-plugin-commonjs"
import { defineConfig } from "vite"
import pkg from "./package.json"

const { dependencies } = pkg

export default defineConfig({
plugins: [sveltekit()],
plugins: [
viteCommonjs({
include: ["country-list"],
}),
sveltekit(),
],
ssr: {
noExternal: [...Object.keys(dependencies)],
},
Expand Down
Loading

3 comments on commit aaa733e

@vercel
Copy link

@vercel vercel bot commented on aaa733e May 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-nextjs – ./examples/next-ts

zag-nextjs-chakra-ui.vercel.app
zag-nextjs-git-main-chakra-ui.vercel.app
zag-two.vercel.app

@vercel
Copy link

@vercel vercel bot commented on aaa733e May 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-vue – ./examples/vue-ts

zag-vue.vercel.app
zag-vue-chakra-ui.vercel.app
zag-vue-git-main-chakra-ui.vercel.app

@vercel
Copy link

@vercel vercel bot commented on aaa733e May 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-solid – ./examples/solid-ts

zag-solid-git-main-chakra-ui.vercel.app
zag-solid-chakra-ui.vercel.app
zag-solid.vercel.app

Please sign in to comment.