Skip to content

Commit

Permalink
[feat] explicitly set compilerOptions.hydratable to config.kit.hydrate (
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikg authored and benmccann committed Jul 27, 2021
1 parent 538de3e commit b18a45c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/nervous-items-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

explicitly set compilerOptions.hydratable to config.kit.hydrate
10 changes: 8 additions & 2 deletions packages/kit/src/core/build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ async function build_client({
plugins: [
svelte({
extensions: config.extensions,
emitCss: !config.kit.amp
emitCss: !config.kit.amp,
compilerOptions: {
hydratable: !!config.kit.hydrate
}
})
]
});
Expand Down Expand Up @@ -463,7 +466,10 @@ async function build_server(
},
plugins: [
svelte({
extensions: config.extensions
extensions: config.extensions,
compilerOptions: {
hydratable: !!config.kit.hydrate
}
})
],
// this API is marked as @alpha https://github.com/vitejs/vite/blob/27785f7fcc5b45987b5f0bf308137ddbdd9f79ea/packages/vite/src/node/config.ts#L129
Expand Down
5 changes: 4 additions & 1 deletion packages/kit/src/core/dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ class Watcher extends EventEmitter {
plugins: [
svelte({
extensions: this.config.extensions,
emitCss: !this.config.kit.amp
emitCss: !this.config.kit.amp,
compilerOptions: {
hydratable: !!this.config.kit.hydrate
}
})
],
publicDir: this.config.kit.files.assets,
Expand Down

0 comments on commit b18a45c

Please sign in to comment.