@sveltejs/vite-plugin-svelte 1.0.0-next.47 → 1.0.0-next.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -44,7 +44,7 @@ __export(src_exports, {
44
44
  });
45
45
  module.exports = __toCommonJS(src_exports);
46
46
 
47
- // ../../node_modules/.pnpm/tsup@6.0.1/node_modules/tsup/assets/cjs_shims.js
47
+ // ../../node_modules/.pnpm/tsup@6.1.0/node_modules/tsup/assets/cjs_shims.js
48
48
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
49
49
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
50
50
 
@@ -670,6 +670,7 @@ function isSvelteLib(pkg) {
670
670
  }
671
671
  var COMMON_DEPENDENCIES_WITHOUT_SVELTE_FIELD = [
672
672
  "@lukeed/uuid",
673
+ "@playwright/test",
673
674
  "@sveltejs/vite-plugin-svelte",
674
675
  "@sveltejs/kit",
675
676
  "autoprefixer",
@@ -679,6 +680,7 @@ var COMMON_DEPENDENCIES_WITHOUT_SVELTE_FIELD = [
679
680
  "eslint",
680
681
  "jest",
681
682
  "mdsvex",
683
+ "playwright",
682
684
  "postcss",
683
685
  "prettier",
684
686
  "svelte",
@@ -687,7 +689,9 @@ var COMMON_DEPENDENCIES_WITHOUT_SVELTE_FIELD = [
687
689
  "svelte-preprocess",
688
690
  "tslib",
689
691
  "typescript",
690
- "vite"
692
+ "vite",
693
+ "vitest",
694
+ "__vite-browser-external"
691
695
  ];
692
696
  var COMMON_PREFIXES_WITHOUT_SVELTE_FIELD = [
693
697
  "@fontsource/",
@@ -1141,6 +1145,7 @@ function resolveOptions(preResolveOptions2, viteConfig) {
1141
1145
  };
1142
1146
  const merged = mergeConfigs(defaultOptions, preResolveOptions2, extraOptions);
1143
1147
  removeIgnoredOptions(merged);
1148
+ addSvelteKitOptions(merged);
1144
1149
  addExtraPreprocessors(merged, viteConfig);
1145
1150
  enforceOptionsForHmr(merged);
1146
1151
  enforceOptionsForProduction(merged);
@@ -1203,6 +1208,17 @@ function removeIgnoredOptions(options) {
1203
1208
  });
1204
1209
  }
1205
1210
  }
1211
+ function addSvelteKitOptions(options) {
1212
+ var _a, _b;
1213
+ if ((options == null ? void 0 : options.kit) != null) {
1214
+ const hydratable = ((_a = options.kit.browser) == null ? void 0 : _a.hydrate) !== false;
1215
+ if (options.compilerOptions.hydratable != null && options.compilerOptions.hydratable !== hydratable) {
1216
+ log.warn(`Conflicting values "compilerOptions.hydratable: ${options.compilerOptions.hydratable}" and "kit.browser.hydrate: ${(_b = options.kit.browser) == null ? void 0 : _b.hydrate}" in your svelte config. You should remove "compilerOptions.hydratable".`);
1217
+ }
1218
+ log.debug(`Setting compilerOptions.hydratable: ${hydratable} for SvelteKit`);
1219
+ options.compilerOptions.hydratable = hydratable;
1220
+ }
1221
+ }
1206
1222
  function resolveViteRoot(viteConfig) {
1207
1223
  return (0, import_vite3.normalizePath)(viteConfig.root ? import_path4.default.resolve(viteConfig.root) : process.cwd());
1208
1224
  }