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 5.0.1 to 5.0.2

43

index.js

@@ -32,3 +32,5 @@ const fs = require('fs');

extensions: true,
shared: true
shared: true,
emitCss: true,
preprocess: true
};

@@ -122,3 +124,3 @@

const fixedOptions = {};
const fixed_options = {};

@@ -128,7 +130,12 @@ Object.keys(options).forEach(key => {

if (pluginOptions[key]) return;
fixedOptions[key] = options[key];
fixed_options[key] = options[key];
});
fixedOptions.format = major_version >= 3 ? 'esm' : 'es';
fixedOptions.shared = require.resolve(options.shared || (major_version >= 3 ? 'svelte/internal.js' : 'svelte/shared.js'));
if (major_version >= 3) {
fixed_options.format = 'esm';
fixed_options.sveltePath = options.sveltePath || 'svelte';
} else {
fixed_options.format = 'es';
fixed_options.shared = require.resolve(options.shared || 'svelte/shared.js');
}

@@ -149,7 +156,7 @@ // handle CSS extraction

if (css || options.emitCss) {
fixedOptions.css = false;
fixed_options.css = false;
}
if (options.onwarn) {
fixedOptions.onwarn = options.onwarn;
fixed_options.onwarn = options.onwarn;
}

@@ -226,10 +233,13 @@

return preprocessPromise.then(code => {
let warnings = [];
const base_options = major_version < 3
? {
onwarn: warning => warnings.push(warning)
}
: {};
const compiled = compile(
code,
Object.assign({}, {
onwarn: warning => {
if ((options.css || !options.emitCss) && warning.code === 'css-unused-selector') return;
this.warn(warning);
}
}, fixedOptions, {
Object.assign(base_options, fixed_options, {
name: capitalize(sanitize(id)),

@@ -240,2 +250,9 @@ filename: id

if (major_version >= 3) warnings = compiled.warnings || compiled.stats.warnings;
warnings.forEach(warning => {
if ((options.css || !options.emitCss) && warning.code === 'css-unused-selector') return;
this.warn(warning);
});
if ((css || options.emitCss) && compiled.css.code) {

@@ -242,0 +259,0 @@ let fname = id.replace(extension, '.css');

{
"name": "rollup-plugin-svelte",
"version": "5.0.1",
"version": "5.0.2",
"description": "Compile Svelte components with Rollup",

@@ -34,3 +34,3 @@ "main": "index.js",

"source-map": "^0.6.1",
"svelte": "^3.0.0-alpha2"
"svelte": "^3.0.0-beta.5"
},

@@ -37,0 +37,0 @@ "dependencies": {

@@ -30,8 +30,8 @@ # rollup-plugin-svelte

svelte({
// By default, all .html and .svelte files are compiled
extensions: [ '.my-custom-extension' ],
// By default, all .svelte and .html files are compiled
extensions: ['.my-custom-extension'],
// You can restrict which files are compiled
// using `include` and `exclude`
include: 'src/components/**/*.html',
include: 'src/components/**/*.svelte',

@@ -82,4 +82,4 @@ // By default, the client-side compiler is used. You

// this means 'some-component' resolves to 'some-component/src/SomeComponent.html'
"svelte": "src/MyComponent.html"
// this means 'some-component' resolves to 'some-component/src/SomeComponent.svelte'
"svelte": "src/MyComponent.svelte"
}

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