@sveltejs/vite-plugin-svelte
Advanced tools
Comparing version 2.0.1 to 2.0.2
{ | ||
"name": "@sveltejs/vite-plugin-svelte", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"license": "MIT", | ||
@@ -53,3 +53,3 @@ "author": "dominikg", | ||
"@types/debug": "^4.1.7", | ||
"esbuild": "^0.16.3", | ||
"esbuild": "^0.16.4", | ||
"rollup": "^2.79.1", | ||
@@ -56,0 +56,0 @@ "svelte": "^3.54.0", |
@@ -38,18 +38,19 @@ import { Plugin, normalizePath } from 'vite'; | ||
const vps = config.plugins.find((p) => p.name === 'vite-plugin-svelte'); | ||
if (vps?.api?.options?.experimental?.inspector) { | ||
inspectorOptions = { | ||
...defaultInspectorOptions, | ||
...vps.api.options.experimental.inspector | ||
}; | ||
} | ||
if (!vps || !inspectorOptions) { | ||
const options = vps?.api?.options?.experimental?.inspector; | ||
if (!vps || !options) { | ||
log.debug('inspector disabled, could not find config'); | ||
disabled = true; | ||
} else { | ||
if (vps.api.options.kit && !inspectorOptions.appendTo) { | ||
const out_dir = path.basename(vps.api.options.kit.outDir || '.svelte-kit'); | ||
inspectorOptions.appendTo = `${out_dir}/generated/root.svelte`; | ||
} | ||
appendTo = inspectorOptions.appendTo; | ||
return; | ||
} | ||
inspectorOptions = { | ||
...defaultInspectorOptions, | ||
...options | ||
}; | ||
const isSvelteKit = config.plugins.some((p) => p.name.startsWith('vite-plugin-sveltekit')); | ||
if (isSvelteKit && !inspectorOptions.appendTo) { | ||
// this could append twice if a user had a file that ends with /generated/root.svelte | ||
// but that should be rare and inspector doesn't execute twice | ||
inspectorOptions.appendTo = `/generated/root.svelte`; | ||
} | ||
appendTo = inspectorOptions.appendTo; | ||
}, | ||
@@ -56,0 +57,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
360923