Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: svelte deploy #232

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deploy-gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
run: |
mkdir build
cp -r examples/sample-vue-app/dist build/vue
cp -r examples/sample-svelte-app/dist build/svelte
cp -r examples/sample-react-app/dist build/react
cp -r examples/sample-vanilla-app/dist build/vanilla
cp -r examples/sample-angular-app/dist/easy-angular build/angular
Expand Down
6 changes: 3 additions & 3 deletions examples/sample-svelte-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"private": true,
"type": "module",
"scripts": {
"build": "vite build --mode=development",
"build": "vite build",
"clean": "rm -rf .svelte-kit dist .turbo",
"dev": "vite dev",
"gh-pages-build": "vite build",
"gh-pages-build": "BASE_PATH='/vechain-dapp-kit/svelte' vite build",
"lint": "eslint src --ext .js,.jsx,.ts,.tsx",
"preview": "vite preview --mode=development",
"preview": "vite preview",
"purge": "yarn clean; rm -rf node_modules"
},
"dependencies": {
Expand Down
6 changes: 4 additions & 2 deletions examples/sample-svelte-app/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/kit/vite';

const basePath = process.env.BASE_PATH ?? '';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
Expand All @@ -18,8 +18,10 @@ const config = {
assets: 'dist',
fallback: undefined,
precompress: true,
strict: true,
}),
paths: {
base: basePath,
},
},
};

Expand Down
5 changes: 2 additions & 3 deletions examples/sample-svelte-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { nodePolyfills } from 'vite-plugin-node-polyfills';

export default defineConfig(({ mode }) => ({
export default defineConfig({
plugins: [nodePolyfills(), sveltekit()],
preview: {
port: 5005,
Expand All @@ -19,5 +19,4 @@ export default defineConfig(({ mode }) => ({
transformMixedEsModules: true,
},
},
base: mode === 'production' ? '/vechain-dapp-kit/svelte/' : '/',
}));
});
Loading