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
110
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 1.0.0-next.39 to 1.0.0-next.40

17

dist/index.js

@@ -1173,3 +1173,3 @@ var __defProp = Object.defineProperty;

}
function buildExtraViteConfig(options, config, configEnv) {
function buildExtraViteConfig(options, config) {
const svelteDeps = findRootSvelteDependencies(options.root);

@@ -1182,6 +1182,6 @@ const extraViteConfig = {

};
if (configEnv.command === "serve") {
if (options.isServe) {
extraViteConfig.optimizeDeps = buildOptimizeDepsForSvelte(svelteDeps, options, config.optimizeDeps);
}
extraViteConfig.ssr = buildSSROptionsForSvelte(svelteDeps, options, config);
extraViteConfig.ssr = buildSSROptionsForSvelte(svelteDeps, options, config, extraViteConfig);
return extraViteConfig;

@@ -1249,5 +1249,12 @@ }

}));
return {
const ssr = {
noExternal
};
if (options.isServe) {
ssr.external = Array.from(new Set(svelteDeps.flatMap((dep) => Object.keys(dep.pkg.dependencies || {})))).filter((dep) => {
var _a2, _b2, _c2, _d;
return !ssr.noExternal.includes(dep) && !((_b2 = (_a2 = config.ssr) == null ? void 0 : _a2.noExternal) == null ? void 0 : _b2.includes(dep)) && !((_d = (_c2 = config.ssr) == null ? void 0 : _c2.external) == null ? void 0 : _d.includes(dep));
});
}
return ssr;
}

@@ -1528,3 +1535,3 @@ function patchResolvedViteConfig(viteConfig, options) {

options = await preResolveOptions(inlineOptions, config, configEnv);
const extraViteConfig = buildExtraViteConfig(options, config, configEnv);
const extraViteConfig = buildExtraViteConfig(options, config);
log.debug("additional vite config", extraViteConfig);

@@ -1531,0 +1538,0 @@ return extraViteConfig;

{
"name": "@sveltejs/vite-plugin-svelte",
"version": "1.0.0-next.39",
"version": "1.0.0-next.40",
"license": "MIT",

@@ -43,7 +43,7 @@ "author": "dominikg",

"dependencies": {
"@rollup/pluginutils": "^4.1.2",
"@rollup/pluginutils": "^4.2.0",
"debug": "^4.3.3",
"kleur": "^4.1.4",
"magic-string": "^0.25.7",
"svelte-hmr": "^0.14.9"
"magic-string": "^0.26.1",
"svelte-hmr": "^0.14.11"
},

@@ -64,7 +64,7 @@ "peerDependencies": {

"diff-match-patch": "^1.0.5",
"esbuild": "^0.14.23",
"rollup": "^2.68.0",
"esbuild": "^0.14.26",
"rollup": "^2.70.1",
"svelte": "^3.46.4",
"tsup": "^5.11.13",
"vite": "^2.8.4"
"tsup": "^5.12.1",
"vite": "^2.8.6"
},

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

@@ -58,3 +58,3 @@ import fs from 'fs';

// extra vite config
const extraViteConfig = buildExtraViteConfig(options, config, configEnv);
const extraViteConfig = buildExtraViteConfig(options, config);
log.debug('additional vite config', extraViteConfig);

@@ -61,0 +61,0 @@ return extraViteConfig;

@@ -187,4 +187,3 @@ /* eslint-disable no-unused-vars */

options: PreResolvedOptions,
config: UserConfig,
configEnv: ConfigEnv
config: UserConfig
): Partial<UserConfig> {

@@ -204,3 +203,3 @@ // extra handling for svelte dependencies in the project

if (configEnv.command === 'serve') {
if (options.isServe) {
extraViteConfig.optimizeDeps = buildOptimizeDepsForSvelte(

@@ -214,3 +213,3 @@ svelteDeps,

// @ts-ignore
extraViteConfig.ssr = buildSSROptionsForSvelte(svelteDeps, options, config);
extraViteConfig.ssr = buildSSROptionsForSvelte(svelteDeps, options, config, extraViteConfig);

@@ -300,3 +299,3 @@ return extraViteConfig;

if (options.isBuild && config.build?.ssr) {
// @ts-ignore
// @ts-expect-error ssr still flagged in vite
if (!config.ssr?.external?.includes('svelte')) {

@@ -316,9 +315,26 @@ noExternal.push('svelte');

...Array.from(new Set(svelteDeps.map((s) => s.name))).filter((x) => {
// @ts-ignore
// @ts-expect-error ssr still flagged in vite
return !config.ssr?.external?.includes(x) && !config.optimizeDeps?.include?.includes(x);
})
);
return {
const ssr = {
noExternal
};
if (options.isServe) {
// during dev, we have to externalize transitive dependencies, see https://github.com/sveltejs/vite-plugin-svelte/issues/281
// @ts-expect-error ssr still flagged in vite
ssr.external = Array.from(
new Set(svelteDeps.flatMap((dep) => Object.keys(dep.pkg.dependencies || {})))
).filter(
(dep) =>
!ssr.noExternal.includes(dep) &&
// @ts-expect-error ssr still flagged in vite
!config.ssr?.noExternal?.includes(dep) &&
// @ts-expect-error ssr still flagged in vite
!config.ssr?.external?.includes(dep)
);
}
return ssr;
}

@@ -325,0 +341,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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