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

@rollup/plugin-swc

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rollup/plugin-swc - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

6

dist/cjs/index.js

@@ -5,2 +5,3 @@ 'use strict';

var pluginutils = require('@rollup/pluginutils');
var core = require('@swc/core');

@@ -10,2 +11,3 @@ var smob = require('smob');

function swc(input = {}) {
const filter = pluginutils.createFilter(input.include, input.exclude);
const swcOptions = smob.merge({}, input.swc || {}, {

@@ -27,3 +29,5 @@ jsc: {

name: 'swc',
transform(code) {
transform(code, id) {
if (!filter(id))
return null;
return core.transform(code, {

@@ -30,0 +34,0 @@ ...swcOptions,

@@ -0,1 +1,2 @@

import { createFilter } from '@rollup/pluginutils';
import { transform } from '@swc/core';

@@ -5,2 +6,3 @@ import { merge } from 'smob';

function swc(input = {}) {
const filter = createFilter(input.include, input.exclude);
const swcOptions = merge({}, input.swc || {}, {

@@ -22,3 +24,5 @@ jsc: {

name: 'swc',
transform(code) {
transform(code, id) {
if (!filter(id))
return null;
return transform(code, {

@@ -25,0 +29,0 @@ ...swcOptions,

7

package.json
{
"name": "@rollup/plugin-swc",
"version": "0.1.1",
"version": "0.2.0",
"publishConfig": {

@@ -65,6 +65,7 @@ "access": "public"

"dependencies": {
"smob": "^1.0.0"
"@rollup/pluginutils": "^5.0.1",
"smob": "^1.4.0"
},
"devDependencies": {
"@swc/core": "^1.3.58",
"@swc/core": "^1.3.78",
"rollup": "^3.0.0-7",

@@ -71,0 +72,0 @@ "typescript": "^4.8.3"

@@ -51,4 +51,8 @@ [npm]: https://img.shields.io/npm/v/@rollup/plugin-swc

The plugin accepts an object as input parameter to modify the default behaviour.
This object has an `swc` property to provide library specific [Options](https://swc.rs/docs/configuration/swcrc).
### `swc`
- Type: [Options](https://swc.rs/docs/configuration/swcrc)
- Default: `undefined`
```typescript

@@ -62,2 +66,18 @@ import type { Options as SWCOptions } from '@swc/core';

### `exclude`
- Type: `String` | `Array[...String]`
- Default: `null`
A [picomatch pattern](https://github.com/micromatch/picomatch),
or array of patterns, which specifies the files in the build the plugin should _ignore_. By default no files are ignored.
### `include`
- Type: `String` | `Array[...String]`
- Default: `null`
A [picomatch pattern](https://github.com/micromatch/picomatch),
or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.
## Alternatives

@@ -64,0 +84,0 @@

import type { Plugin } from 'rollup';
import { createFilter } from '@rollup/pluginutils';
import type { Options as SWCOptions } from '@swc/core';

@@ -9,2 +10,4 @@ import { transform } from '@swc/core';

export function swc(input: Options = {}): Plugin {
const filter = createFilter(input.include, input.exclude);
const swcOptions: SWCOptions = merge({}, input.swc || {}, {

@@ -27,3 +30,5 @@ jsc: {

name: 'swc',
transform(code) {
transform(code, id) {
if (!filter(id)) return null;
return transform(code, {

@@ -30,0 +35,0 @@ ...swcOptions,

@@ -0,1 +1,2 @@

import type { FilterPattern } from '@rollup/pluginutils';
import type { Options as SWCOptions } from '@swc/core';

@@ -5,2 +6,6 @@

swc?: SWCOptions;
include?: FilterPattern;
exclude?: FilterPattern;
}
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