Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sveltejs/vite-plugin-svelte

Package Overview
Dependencies
Maintainers
4
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sveltejs/vite-plugin-svelte - npm Package Compare versions

Comparing version 5.0.1 to 5.0.2

16

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

@@ -39,8 +39,8 @@ "author": "dominikg",

"dependencies": {
"@sveltejs/vite-plugin-svelte-inspector": "^4.0.0",
"debug": "^4.3.7",
"@sveltejs/vite-plugin-svelte-inspector": "^4.0.1",
"debug": "^4.4.0",
"deepmerge": "^4.3.1",
"kleur": "^4.1.5",
"magic-string": "^0.30.13",
"vitefu": "^1.0.3"
"magic-string": "^0.30.15",
"vitefu": "^1.0.4"
},

@@ -54,5 +54,5 @@ "peerDependencies": {

"esbuild": "^0.24.0",
"sass": "^1.81.0",
"svelte": "^5.2.7",
"vite": "^6.0.0"
"sass": "^1.82.0",
"svelte": "^5.10.0",
"vite": "^6.0.3"
},

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

@@ -105,2 +105,12 @@ import { buildExtendedLogMessage } from './log.js';

/**
*
* @param {string} code the svelte error code
* @see https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/compiler/errors.js
* @returns {boolean}
*/
function couldBeFixedByCssPreprocessor(code) {
return code === 'expected_token' || code === 'unexpected_eof' || code.startsWith('css_');
}
/**
* @param {import('svelte/compiler').Warning & Error} err a svelte compiler error, which is a mix of Warning and an error

@@ -117,3 +127,3 @@ * @param {string} originalCode

// Handle incorrect CSS preprocessor usage
if (err.code === 'css-syntax-error') {
if (couldBeFixedByCssPreprocessor(err.code)) {
// Reference from Svelte: https://github.com/sveltejs/svelte/blob/9926347ad9dbdd0f3324d5538e25dcb7f5e442f8/packages/svelte/src/compiler/preprocess/index.js#L257

@@ -120,0 +130,0 @@ const styleRe =

@@ -185,3 +185,3 @@ /* eslint-disable no-console */

return (
(!emitCss && warning.code === 'css-unused-selector') || // same as rollup-plugin-svelte
(!emitCss && warning.code === 'css_unused_selector') || // same as rollup-plugin-svelte
(!isBuild && isNoScopableElementWarning(warning))

@@ -198,3 +198,3 @@ );

// see https://github.com/sveltejs/vite-plugin-svelte/issues/153
return warning.code === 'css-unused-selector' && warning.message.includes('"*"');
return warning.code === 'css_unused_selector' && warning.message.includes('"*"');
}

@@ -201,0 +201,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc