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

rollup-plugin-svelte

Package Overview
Dependencies
Maintainers
2
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-svelte - npm Package Compare versions

Comparing version 4.4.0 to 4.5.0

4

CHANGELOG.md
# rollup-plugin-svelte changelog
## 4.5.0
* Pass `dependencies` through from preprocessors ([#40](https://github.com/rollup/rollup-plugin-svelte/issues/40))
## 4.4.0

@@ -4,0 +8,0 @@

@@ -201,5 +201,24 @@ const fs = require('fs');

return (options.preprocess ? preprocess(code, Object.assign({}, options.preprocess, { filename : id })) : Promise.resolve(code)).then(code => {
const dependencies = [];
let preprocessPromise;
if (options.preprocess) {
const preprocessOptions = {};
for (const key in options.preprocess) {
preprocessOptions[key] = (...args) => {
return Promise.resolve(options.preprocess[key](...args)).then(resp => {
if (resp && resp.dependencies) {
dependencies.push(...resp.dependencies);
}
return resp;
});
};
}
preprocessPromise = preprocess(code, Object.assign(preprocessOptions, { filename: id })).then(code => code.toString());
} else {
preprocessPromise = Promise.resolve(code);
}
return preprocessPromise.then(code => {
const compiled = compile(
code.toString(),
code,
Object.assign({}, {

@@ -229,2 +248,4 @@ onwarn: warning => {

compiled.js.dependencies = dependencies;
return compiled.js;

@@ -231,0 +252,0 @@ });

2

package.json
{
"name": "rollup-plugin-svelte",
"version": "4.4.0",
"version": "4.5.0",
"description": "Compile Svelte components with Rollup",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -68,2 +68,7 @@ # rollup-plugin-svelte

## Preprocessing and dependencies
If you are using the `preprocess` feature, then your callback responses may — in addition to the `code` and `map` values described in the Svelte compile docs — also optionally include a `dependencies` array. This should be the paths of additional files that the preprocessor result in some way depends upon. In Rollup 0.61+ in watch mode, any changes to these additional files will also trigger re-builds.
## `pkg.svelte`

@@ -70,0 +75,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