svelte-jsoneditor
Advanced tools
Comparing version 0.3.11 to 0.3.12
@@ -5,2 +5,4 @@ # Changelog | ||
### [0.3.12](https://github.com/josdejong/svelte-jsoneditor/compare/v0.3.11...v0.3.12) (2022-01-05) | ||
### [0.3.11](https://github.com/josdejong/svelte-jsoneditor/compare/v0.3.10...v0.3.11) (2022-01-05) | ||
@@ -7,0 +9,0 @@ |
{ | ||
"name": "svelte-jsoneditor", | ||
"description": "A web-based tool to view, edit, format, transform, and validate JSON", | ||
"version": "0.3.11", | ||
"version": "0.3.12", | ||
"type": "module", | ||
@@ -147,2 +147,3 @@ "svelte": "index.js", | ||
"./components/modes/treemode/Welcome.svelte": "./components/modes/treemode/Welcome.svelte", | ||
"./config": "./config.js", | ||
"./constants": "./constants.js", | ||
@@ -149,0 +150,0 @@ "./generated/.gitignore": "./generated/.gitignore", |
@@ -27,2 +27,31 @@ # svelte-jsoneditor | ||
### SvelteKit setup | ||
There is currently an issue in SvelteKit with processing some dependencies (more precisely: Vite used by SvelteKit). `svelte-jsoneditor` depends on some libraries that hit this issue. To work around it, each of these dependencies needs to be listed in the configuration. Without the workaround, you'll see errors like "ReferenceError: module is not defined" (for `debug`, `ajv`, `ace-builds`, etc.). | ||
In your SvelteKit configuration file `svelte.config.js`, add the list with dependencies `viteOptimizeDeps`, available in the `svelte-jsoneditor/config.js`, and use that in the configuration of vite (`config.kit.vite.optimizeDeps.include`): | ||
```js | ||
// svelte.config.js | ||
// ... | ||
import { viteOptimizeDeps } from 'svelte-jsoneditor/config' | ||
const config = { | ||
// ... | ||
kit: { | ||
// ... | ||
vite: { | ||
optimizeDeps: { | ||
include: [...viteOptimizeDeps] | ||
} | ||
} | ||
} | ||
} | ||
// ... | ||
``` | ||
### Svelte usage | ||
@@ -29,0 +58,0 @@ |
6161750
198
15559
440