Skip to content

Chore: fix doc site script #212

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

Merged
merged 2 commits into from
Aug 5, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/GHPages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./build
path: ./build/eslint-plugin-svelte
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
6 changes: 4 additions & 2 deletions svelte.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ fs.writeFileSync(
JSON.stringify({ type: "module" }),
)

const outDir = path.join(dirname, "build/eslint-plugin-svelte")

/** @type {import('@sveltejs/kit').Config} */
const config = {
compilerOptions: {
Expand All @@ -31,8 +33,8 @@ const config = {
},
adapter: ghpagesAdapter({
// default options are shown
pages: "build",
assets: "build",
pages: outDir,
assets: outDir,
Copy link
Member Author

Choose a reason for hiding this comment

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

This is changes the output destination of the documentation build files.
With this change, we can test static site by simply using the npx http-server command in build directory.

}),
prerender: {
default: true,
Expand Down
7 changes: 7 additions & 0 deletions vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ const config: UserConfig = {
acorn: path.join(dirname, "./node_modules/acorn/dist/acorn.js"),
},
},
ssr: {
// vite-plugin-svelte recognizes svelte-eslint-parser as a library that runs on svelte.
// This confuses the SSR on the Dev server.
// This is the workaround for that.
// https://github.com/sveltejs/vite-plugin-svelte/blob/a1d141e890ac0d1572a46e2bec705aa090236560/packages/vite-plugin-svelte/src/utils/dependencies.ts#L114
external: ["svelte-eslint-parser"],
},
build: {
commonjsOptions: {
ignoreDynamicRequires: true,
Expand Down