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: deploy server assets #9073

Merged
merged 3 commits into from
Feb 16, 2023
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
5 changes: 5 additions & 0 deletions .changeset/cuddly-seals-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: deploy server assets. Only works with Vite 4.1+
2 changes: 1 addition & 1 deletion packages/adapter-static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"svelte": "^3.55.1",
"typescript": "^4.9.4",
"uvu": "^0.5.6",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"peerDependencies": {
"@sveltejs/kit": "^1.5.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-static/test/apps/prerendered/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"devDependencies": {
"@sveltejs/kit": "workspace:^",
"svelte": "^3.55.1",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/adapter-static/test/apps/spa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@sveltejs/kit": "workspace:^",
"sirv-cli": "^2.0.2",
"svelte": "^3.55.1",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/create-svelte/templates/default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@sveltejs/kit": "workspace:*",
"svelte": "^3.55.1",
"typescript": "^4.9.4",
"vite": "^4.0.0"
"vite": "^4.1.1"
},
"type": "module",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"svelte-preprocess": "^5.0.0",
"typescript": "^4.9.4",
"uvu": "^0.5.6",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"peerDependencies": {
"svelte": "^3.54.0",
Expand Down
8 changes: 7 additions & 1 deletion packages/kit/src/core/adapt/builder.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { existsSync, statSync, createReadStream, createWriteStream } from 'node:fs';
import { join } from 'node:path/posix';
import { pipeline } from 'node:stream';
import { promisify } from 'node:util';
import zlib from 'node:zlib';
Expand Down Expand Up @@ -181,7 +182,12 @@ export function create_builder({
},

writeClient(dest) {
return [...copy(`${config.kit.outDir}/output/client`, dest)];
const server_assets = copy(
`${config.kit.outDir}/output/server/${config.kit.appDir}/immutable/assets`,
join(dest, config.kit.appDir, 'immutable/assets')
);
const client_assets = copy(`${config.kit.outDir}/output/client`, dest);
return Array.from(new Set(...server_assets, ...client_assets));
},

// @ts-expect-error
Expand Down
1 change: 1 addition & 0 deletions packages/kit/src/exports/vite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ export function set_assets(path) {
},
preserveEntrySignatures: 'strict'
},
ssrEmitAssets: true,
target: ssr ? 'node16.14' : undefined,
// don't use the default name to avoid collisions with 'static/manifest.json'
manifest: 'vite-manifest.json'
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/test/apps/amp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/kit/test/apps/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/kit/test/apps/dev-only/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/kit/test/apps/options-2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/kit/test/apps/options/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/kit/test/apps/writes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/kit/test/prerendering/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"uvu": "^0.5.6",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/kit/test/prerendering/options/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"uvu": "^0.5.6",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/kit/test/prerendering/paths-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"uvu": "^0.5.6",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/kit/test/prerendering/ssr-false/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"svelte-check": "^3.0.2",
"typescript": "^4.9.4",
"uvu": "^0.5.6",
"vite": "^4.0.4"
"vite": "^4.1.1"
},
"type": "module"
}
Loading