@sveltejs/vite-plugin-svelte
Advanced tools
Comparing version 1.0.0-next.23 to 1.0.0-next.24
@@ -810,3 +810,3 @@ var __create = Object.create; | ||
if (configEnv.command === "serve") { | ||
extraViteConfig.optimizeDeps = buildOptimizeDepsForSvelte(svelteDeps.filter((dep) => dep.type === "component-library"), options, config.optimizeDeps); | ||
extraViteConfig.optimizeDeps = buildOptimizeDepsForSvelte(svelteDeps, options, config.optimizeDeps); | ||
} | ||
@@ -826,2 +826,3 @@ extraViteConfig.ssr = buildSSROptionsForSvelte(svelteDeps, options, config); | ||
function buildOptimizeDepsForSvelte(svelteDeps, options, optimizeDeps) { | ||
svelteDeps = svelteDeps.filter((dep) => dep.type === "component-library"); | ||
const include = []; | ||
@@ -868,2 +869,4 @@ const exclude = ["svelte-hmr"]; | ||
} | ||
} else { | ||
svelteDeps = svelteDeps.filter((dep) => dep.type === "component-library"); | ||
} | ||
@@ -870,0 +873,0 @@ noExternal.push(...Array.from(new Set(svelteDeps.map((s) => s.name))).filter((x) => { |
{ | ||
"name": "@sveltejs/vite-plugin-svelte", | ||
"version": "1.0.0-next.23", | ||
"version": "1.0.0-next.24", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": "dominikg", |
@@ -202,3 +202,3 @@ /* eslint-disable no-unused-vars */ | ||
extraViteConfig.optimizeDeps = buildOptimizeDepsForSvelte( | ||
svelteDeps.filter((dep) => dep.type === 'component-library'), | ||
svelteDeps, | ||
options, | ||
@@ -231,2 +231,4 @@ config.optimizeDeps | ||
): DepOptimizationOptions { | ||
// only svelte component libraries needs to be processed for optimizeDeps, js libraries work fine | ||
svelteDeps = svelteDeps.filter((dep) => dep.type === 'component-library'); | ||
// include svelte imports for optimization unless explicitly excluded | ||
@@ -297,2 +299,8 @@ const include: string[] = []; | ||
} | ||
} else { | ||
// for non-ssr build, we exclude svelte js library deps to make development faster | ||
// and also because vite doesn't handle them properly. | ||
// see https://github.com/sveltejs/vite-plugin-svelte/issues/168 | ||
// see https://github.com/vitejs/vite/issues/2579 | ||
svelteDeps = svelteDeps.filter((dep) => dep.type === 'component-library'); | ||
} | ||
@@ -299,0 +307,0 @@ |
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 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
369830
4939