Conversation
benmccann
left a comment
There was a problem hiding this comment.
Going to make lots of people super happy! Big announcement for the Summit 😄
Do you think it's worth filing an issue about force disabling SSR as well? #754 (comment)
packages/adapter-static/index.js
Outdated
|
|
||
| return adapter; | ||
| }; | ||
| import commonjs from './index.cjs'; |
There was a problem hiding this comment.
it could be worth adding a comment here explaining why we need to use CommonJS with an ESM wrapper
There was a problem hiding this comment.
I realised there's actually no benefit to this file — removed
packages/adapter-static/package.json
Outdated
| "format": "prettier --write . --config ../../.prettierrc --ignore-path .gitignore", | ||
| "check-format": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore" | ||
| "check-format": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore", | ||
| "test": "rm -rf test/apps/*/build && uvu test test.js" |
There was a problem hiding this comment.
#1183 this change can make test work in windows
I'd rather wait for that to come up organically — I would rather we investigate alternatives (like static analysis) before providing an 'eject' button that is likely to be misused. People will just forcibly disable SSR as soon as they run into the smallest SSR problem if the option is available to them, rather than working through the problem and preserving SSR-ability where possible. That would be bad stewardship on our part. |
| @@ -1,4 +1,4 @@ | |||
| module.exports = function ({ pages = 'build', assets = 'build' } = {}) { | |||
| module.exports = function ({ pages = 'build', assets = pages, fallback = null } = {}) { | |||
There was a problem hiding this comment.
Why did this file need to be renamed to .cjs?
There was a problem hiding this comment.
|
I have a requirement package an app using the |
Closes #754.
With this, we can specify a
fallbackpage when usingadapter-static. This page contains no content, but will load the SvelteKit app and invoke the router, making it suitable as a200.htmlwith e.g. Surge, or anindex.htmlwith sirv withopts.single.If a fallback is specified,
adapter-staticwon't forcibly prerender every page, just the ones withprerender = true.I added a test suite to
adapter-static.Before submitting the PR, please make sure you do the following
Tests
pnpm testand lint the project withpnpm lintChangesets
pnpx changesetand following the prompts