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

svelte-loader

Package Overview
Dependencies
Maintainers
5
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-loader - npm Package Compare versions

Comparing version 3.2.3 to 3.2.4

16

index.js

@@ -66,3 +66,3 @@ const path = require('path');

const svelte_module_regex = /\.svelte(\.[^./\\]+)*\.(js|ts)$/
const svelte_module_regex = /\.svelte(\.[^./\\]+)*\.(js|ts)$/;

@@ -92,7 +92,9 @@ module.exports = function(source, map) {

if (getMajor() >= 5 && svelte_module_regex.test(this.resourcePath)) {
let js, warnings;
try {
const { js, warnings } = svelte.compileModule(
({ js, warnings } = svelte.compileModule(
source,
{ filename: this.resourcePath, dev: compileOptions.dev, generate: compileOptions.generate }
);
));

@@ -104,4 +106,2 @@ warnings.forEach(

);
callback(null, js.code, js.map);
} catch (err) {

@@ -113,2 +113,6 @@ // wrap error to provide correct

// outside try-catch - if this fails and we catch it,
// calling callback again will mask the error with a "already called" error
callback(null, js.code, js.map);
return;

@@ -183,3 +187,3 @@ }

if (getMajor() < 5 || !err_str.startsWith('CompileError:')) {
err_str = `${err.name}: ${err_str}`
err_str = `${err.name}: ${err_str}`;
}

@@ -186,0 +190,0 @@ callback(new Error(err_str));

{
"name": "svelte-loader",
"version": "3.2.3",
"version": "3.2.4",
"author": "Nico Rehwaldt <git_nikku@nixis.de>",

@@ -10,3 +10,4 @@ "description": "A webpack loader for svelte",

"test": "mocha --harmony --full-trace --check-leaks",
"lint": "eslint index.js lib/*.js test/**/*.js"
"lint": "eslint index.js lib/*.js test/**/*.js",
"prepublishOnly": "npm run all"
},

@@ -13,0 +14,0 @@ "keywords": [

@@ -35,8 +35,14 @@ > Undecided yet what bundler to use? We suggest using [SvelteKit](https://kit.svelte.dev), or Vite with [vite-plugin-svelte](https://github.com/sveltejs/vite-plugin-svelte/).

...
// This is only needed if you use Svelte 5+ with TypeScript
// The following two loader entries are only needed if you use Svelte 5+ with TypeScript.
// Also make sure your tsconfig.json includes `"target": "ESNext"` in order to not downlevel syntax
{
test: /\.svelte\.ts$/,
use: ['ts-loader', 'svelte-loader']
use: [ "svelte-loader", "ts-loader"],
},
// This is the config for other .ts files - the regex makes sure to not process .svelte.ts files twice
{
test: /(?<!\.svelte)\.ts$/,
loader: "ts-loader",
},
{
// Svelte 5+:

@@ -43,0 +49,0 @@ test: /\.(svelte|svelte\.js)$/,

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