@sveltejs/vite-plugin-svelte
Advanced tools
Comparing version 5.0.1 to 5.0.2
{ | ||
"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 @@ |
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
126430
3789
Updateddebug@^4.4.0
Updatedmagic-string@^0.30.15
Updatedvitefu@^1.0.4