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

rollup-plugin-babel

Package Overview
Dependencies
Maintainers
31
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-babel - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

4

CHANGELOG.md
# rollup-plugin-babel changelog
## 3.0.1
* Wasn't working, fix bug with transform (not using es2015-classes for preflight check)
## 3.0.0

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

@@ -13,7 +13,26 @@ 'use strict';

function importHelperPlugin () {
function importHelperPlugin (ref) {
var t = ref.types;
/**
* This function is needed because of a bug in Babel 6.x, which prevents the
* declaration of an ExportDefaultDeclaration to be replaced with an
* expression.
* That bug has been fixed in Babel 7.
*/
function replaceWith (path$$1, replacement) {
if (
path$$1.parentPath.isExportDefaultDeclaration() &&
t.isExpression(replacement)
) {
path$$1.parentPath.replaceWith(t.exportDefaultDeclaration(replacement));
} else {
path$$1.replaceWith(replacement);
}
}
return {
visitor: {
ClassDeclaration: function ClassDeclaration (path$$1, state) {
path$$1.replaceWith(state.file.addHelper('classCallCheck'));
replaceWith(path$$1, state.file.addHelper('classCallCheck'));
}

@@ -20,0 +39,0 @@ }

@@ -11,7 +11,26 @@ import { dirname, join } from 'path';

function importHelperPlugin () {
function importHelperPlugin (ref) {
var t = ref.types;
/**
* This function is needed because of a bug in Babel 6.x, which prevents the
* declaration of an ExportDefaultDeclaration to be replaced with an
* expression.
* That bug has been fixed in Babel 7.
*/
function replaceWith (path$$1, replacement) {
if (
path$$1.parentPath.isExportDefaultDeclaration() &&
t.isExpression(replacement)
) {
path$$1.parentPath.replaceWith(t.exportDefaultDeclaration(replacement));
} else {
path$$1.replaceWith(replacement);
}
}
return {
visitor: {
ClassDeclaration: function ClassDeclaration (path$$1, state) {
path$$1.replaceWith(state.file.addHelper('classCallCheck'));
replaceWith(path$$1, state.file.addHelper('classCallCheck'));
}

@@ -18,0 +37,0 @@ }

2

package.json
{
"name": "rollup-plugin-babel",
"version": "3.0.1",
"version": "3.0.2",
"description": "Seamless integration between Rollup and Babel.",

@@ -5,0 +5,0 @@ "main": "dist/rollup-plugin-babel.cjs.js",

@@ -1,6 +0,23 @@

export default function importHelperPlugin () {
export default function importHelperPlugin ({ types: t }) {
/**
* This function is needed because of a bug in Babel 6.x, which prevents the
* declaration of an ExportDefaultDeclaration to be replaced with an
* expression.
* That bug has been fixed in Babel 7.
*/
function replaceWith (path, replacement) {
if (
path.parentPath.isExportDefaultDeclaration() &&
t.isExpression(replacement)
) {
path.parentPath.replaceWith(t.exportDefaultDeclaration(replacement));
} else {
path.replaceWith(replacement);
}
}
return {
visitor: {
ClassDeclaration (path, state) {
path.replaceWith(state.file.addHelper('classCallCheck'));
replaceWith(path, state.file.addHelper('classCallCheck'));
}

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