@sveltejs/vite-plugin-svelte 1.0.5 → 1.0.7
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 +12 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +30 -0
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/ui/inspector/Inspector.svelte +140 -25
- package/src/ui/inspector/plugin.ts +2 -0
- package/src/utils/options.ts +44 -2
package/dist/index.cjs
CHANGED
|
@@ -1270,8 +1270,12 @@ function mergeConfigs(...configs) {
|
|
|
1270
1270
|
return result;
|
|
1271
1271
|
}
|
|
1272
1272
|
function resolveOptions(preResolveOptions2, viteConfig) {
|
|
1273
|
+
var _a;
|
|
1273
1274
|
const defaultOptions = {
|
|
1274
|
-
hot: viteConfig.isProduction ? false : {
|
|
1275
|
+
hot: viteConfig.isProduction ? false : {
|
|
1276
|
+
injectCss: !preResolveOptions2.emitCss,
|
|
1277
|
+
partialAccept: !!((_a = viteConfig.experimental) == null ? void 0 : _a.hmrPartialAccept)
|
|
1278
|
+
},
|
|
1275
1279
|
compilerOptions: {
|
|
1276
1280
|
css: !preResolveOptions2.emitCss,
|
|
1277
1281
|
dev: !viteConfig.isProduction
|
|
@@ -1376,7 +1380,7 @@ function resolveViteRoot(viteConfig) {
|
|
|
1376
1380
|
return (0, import_vite3.normalizePath)(viteConfig.root ? import_path4.default.resolve(viteConfig.root) : process.cwd());
|
|
1377
1381
|
}
|
|
1378
1382
|
function buildExtraViteConfig(options, config) {
|
|
1379
|
-
var _a;
|
|
1383
|
+
var _a, _b;
|
|
1380
1384
|
const svelteDeps = findRootSvelteDependencies(options.root);
|
|
1381
1385
|
const extraViteConfig = {
|
|
1382
1386
|
resolve: {
|
|
@@ -1400,6 +1404,10 @@ function buildExtraViteConfig(options, config) {
|
|
|
1400
1404
|
};
|
|
1401
1405
|
}
|
|
1402
1406
|
extraViteConfig.ssr = buildSSROptionsForSvelte(svelteDeps, options, config, extraViteConfig);
|
|
1407
|
+
if ((options.hot == null || options.hot === true || options.hot && options.hot.partialAccept !== false) && ((_b = config.experimental) == null ? void 0 : _b.hmrPartialAccept) !== false) {
|
|
1408
|
+
log.debug('enabling "experimental.hmrPartialAccept" in vite config');
|
|
1409
|
+
extraViteConfig.experimental = { hmrPartialAccept: true };
|
|
1410
|
+
}
|
|
1403
1411
|
return extraViteConfig;
|
|
1404
1412
|
}
|
|
1405
1413
|
function buildOptimizeDepsForSvelte(svelteDeps, options, optimizeDeps) {
|
|
@@ -1767,6 +1775,8 @@ function idToFile(id) {
|
|
|
1767
1775
|
// src/ui/inspector/plugin.ts
|
|
1768
1776
|
var defaultInspectorOptions = {
|
|
1769
1777
|
toggleKeyCombo: process.platform === "win32" ? "control-shift" : "meta-shift",
|
|
1778
|
+
navKeys: { parent: "ArrowUp", child: "ArrowDown", next: "ArrowRight", prev: "ArrowLeft" },
|
|
1779
|
+
openKey: "Enter",
|
|
1770
1780
|
holdMode: false,
|
|
1771
1781
|
showToggleButton: "active",
|
|
1772
1782
|
toggleButtonPos: "top-right",
|