@sveltejs/vite-plugin-svelte
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "@sveltejs/vite-plugin-svelte", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"license": "MIT", | ||
@@ -65,7 +65,7 @@ "author": "dominikg", | ||
"diff-match-patch": "^1.0.5", | ||
"esbuild": "^0.15.3", | ||
"rollup": "^2.78.0", | ||
"esbuild": "^0.15.5", | ||
"rollup": "^2.78.1", | ||
"svelte": "^3.49.0", | ||
"tsup": "^6.2.2", | ||
"vite": "^3.0.8" | ||
"tsup": "^6.2.3", | ||
"vite": "^3.0.9" | ||
}, | ||
@@ -72,0 +72,0 @@ "scripts": { |
@@ -7,2 +7,3 @@ import { Plugin, normalizePath } from 'vite'; | ||
import fs from 'fs'; | ||
import { idToFile } from './utils'; | ||
@@ -75,3 +76,8 @@ const defaultInspectorOptions: InspectorOptions = { | ||
// read file ourselves to avoid getting shut out by vites fs.allow check | ||
return await fs.promises.readFile(id, 'utf-8'); | ||
const file = idToFile(id); | ||
if (fs.existsSync(file)) { | ||
return await fs.promises.readFile(file, 'utf-8'); | ||
} else { | ||
log.error(`failed to find file for svelte-inspector: ${file}, referenced by id ${id}.`); | ||
} | ||
} | ||
@@ -78,0 +84,0 @@ }, |
@@ -141,3 +141,3 @@ /* eslint-disable no-unused-vars */ | ||
}; | ||
const merged = mergeConfigs<Partial<PreResolvedOptions> | undefined>( | ||
const merged = mergeConfigs<PreResolvedOptions>( | ||
defaultOptions, | ||
@@ -156,6 +156,6 @@ svelteConfig, | ||
function mergeConfigs<T>(...configs: T[]): ResolvedOptions { | ||
let result = {}; | ||
for (const config of configs.filter(Boolean)) { | ||
result = deepmerge<T>(result, config, { | ||
function mergeConfigs<T>(...configs: (Partial<T> | undefined)[]): T { | ||
let result: Partial<T> = {}; | ||
for (const config of configs.filter((x) => x != null)) { | ||
result = deepmerge<T>(result, config!, { | ||
// replace arrays | ||
@@ -165,3 +165,3 @@ arrayMerge: (target: any[], source: any[]) => source ?? target | ||
} | ||
return result as ResolvedOptions; | ||
return result as T; | ||
} | ||
@@ -186,3 +186,3 @@ | ||
}; | ||
const merged: ResolvedOptions = mergeConfigs(defaultOptions, preResolveOptions, extraOptions); | ||
const merged = mergeConfigs<ResolvedOptions>(defaultOptions, preResolveOptions, extraOptions); | ||
@@ -189,0 +189,0 @@ removeIgnoredOptions(merged); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
527118
32
6966