Socket
Socket
Sign inDemoInstall

@sveltejs/vite-plugin-svelte

Package Overview
Dependencies
204
Maintainers
4
Versions
102
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.0 to 2.3.0

70

dist/index.d.ts

@@ -6,70 +6,4 @@ import { InlineConfig, ResolvedConfig, UserConfig, Plugin } from 'vite';

export { MarkupPreprocessor, Preprocessor, PreprocessorGroup, Processed } from 'svelte/types/compiler/preprocess';
import { Options as Options$1 } from '@sveltejs/vite-plugin-svelte-inspector';
interface InspectorOptions {
/**
* define a key combo to toggle inspector,
* @default 'meta-shift' on mac, 'control-shift' on other os
*
* any number of modifiers `control` `shift` `alt` `meta` followed by zero or one regular key, separated by -
* examples: control-shift, control-o, control-alt-s meta-x control-meta
* Some keys have native behavior (e.g. alt-s opens history menu on firefox).
* To avoid conflicts or accidentally typing into inputs, modifier only combinations are recommended.
*/
toggleKeyCombo?: string;
/**
* define keys to select elements with via keyboard
* @default {parent: 'ArrowUp', child: 'ArrowDown', next: 'ArrowRight', prev: 'ArrowLeft' }
*
* improves accessibility and also helps when you want to select elements that do not have a hoverable surface area
* due to tight wrapping
*
* A note for users of screen-readers:
* If you are using arrow keys to navigate the page itself, change the navKeys to avoid conflicts.
* e.g. navKeys: {parent: 'w', prev: 'a', child: 's', next: 'd'}
*
*
* parent: select closest parent
* child: select first child (or grandchild)
* next: next sibling (or parent if no next sibling exists)
* prev: previous sibling (or parent if no prev sibling exists)
*/
navKeys?: {
parent: string;
child: string;
next: string;
prev: string;
};
/**
* define key to open the editor for the currently selected dom node
*
* @default 'Enter'
*/
openKey?: string;
/**
* inspector is automatically disabled when releasing toggleKeyCombo after holding it for a longpress
* @default true
*/
holdMode?: boolean;
/**
* when to show the toggle button
* @default 'active'
*/
showToggleButton?: 'always' | 'active' | 'never';
/**
* where to display the toggle button
* @default top-right
*/
toggleButtonPos?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
/**
* inject custom styles when inspector is active
*/
customStyles?: boolean;
/**
* internal options that are automatically set, not to be set or used by users
*/
__internal?: {
base: string;
};
}
type Options = Omit<SvelteOptions, 'vitePlugin'> & PluginOptionsInline;

@@ -161,3 +95,3 @@ interface PluginOptionsInline extends PluginOptions {

*/
inspector?: InspectorOptions | boolean;
inspector?: Options$1 | boolean;
/**

@@ -164,0 +98,0 @@ * These options are considered experimental and breaking changes to them can occur in any release

14

package.json
{
"name": "@sveltejs/vite-plugin-svelte",
"version": "2.2.0",
"version": "2.3.0",
"license": "MIT",

@@ -18,4 +18,3 @@ "author": "dominikg",

},
"./package.json": "./package.json",
"./src/ui/*": "./src/ui/*"
"./package.json": "./package.json"
},

@@ -46,3 +45,4 @@ "engines": {

"svelte-hmr": "^0.15.1",
"vitefu": "^0.2.4"
"vitefu": "^0.2.4",
"@sveltejs/vite-plugin-svelte-inspector": "^1.0.1"
},

@@ -56,6 +56,6 @@ "peerDependencies": {

"esbuild": "^0.17.18",
"rollup": "^3.21.2",
"svelte": "^3.58.0",
"rollup": "^3.21.6",
"svelte": "^3.59.1",
"tsup": "^6.7.0",
"vite": "^4.3.3"
"vite": "^4.3.5"
},

@@ -62,0 +62,0 @@ "scripts": {

@@ -12,2 +12,4 @@ import fs from 'fs';

// eslint-disable-next-line node/no-missing-import
import { svelteInspector } from '@sveltejs/vite-plugin-svelte-inspector';
// eslint-disable-next-line node/no-missing-import
import { isDepExcluded } from 'vitefu';

@@ -33,3 +35,2 @@ import { handleHotUpdate } from './handle-hot-update';

import { saveSvelteMetadata } from './utils/optimizer';
import { svelteInspector } from './ui/inspector/plugin';
import { VitePluginSvelteCache } from './utils/vite-plugin-svelte-cache';

@@ -240,6 +241,12 @@ import { loadRaw } from './utils/load-raw';

cache.update(compileData);
if (compileData.dependencies?.length && options.server) {
compileData.dependencies.forEach((d) => {
ensureWatchedFile(options.server!.watcher, d, options.root);
});
if (compileData.dependencies?.length) {
if (options.server) {
for (const dep of compileData.dependencies) {
ensureWatchedFile(options.server.watcher, dep, options.root);
}
} else if (options.isBuild && viteConfig.build.watch) {
for (const dep of compileData.dependencies) {
this.addWatchFile(dep);
}
}
}

@@ -246,0 +253,0 @@ log.debug(`transform returns compiled js for ${svelteRequest.filename}`);

@@ -160,4 +160,2 @@ import { CompileOptions, ResolvedOptions } from './options';

compiled.js.dependencies = dependencies;
return {

@@ -199,3 +197,2 @@ filename,

map?: any;
dependencies?: any[];
}

@@ -202,0 +199,0 @@

@@ -21,2 +21,4 @@ /* eslint-disable no-unused-vars */

} from 'svelte/types/compiler/preprocess';
// eslint-disable-next-line node/no-missing-import
import type { Options as InspectorOptions } from '@sveltejs/vite-plugin-svelte-inspector';

@@ -39,3 +41,2 @@ import path from 'path';

import { VitePluginSvelteCache } from './vite-plugin-svelte-cache';
import type { InspectorOptions } from '../ui/inspector/options';

@@ -42,0 +43,0 @@ const allowedPluginOptions = new Set([

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc