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

babel-plugin-system-import-transformer

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-system-import-transformer - npm Package Compare versions

Comparing version 1.1.4 to 1.1.5

29

index.js

@@ -208,27 +208,18 @@ module.exports = function (babel) {

SystemImportExpressionTransformer.prototype.createTransformedExpression = function () {
var amdTest = this.getAmdTest();
var amdRequire = this.getAmdRequire(this.moduleNameLiteral);
var commonJSTest = this.getCommonJSTest();
var componentTest = this.getComponentTest();
var commonJSRequire = this.getCommonJSRequire(this.importedModuleLiteral);
var globalRequire = this.getGlobalRequire(this.moduleNameLiteral);
var commonJSOrComponentTest = t.logicalExpression('||', commonJSTest, componentTest);
var moduleImportExpressions;
if (this.file.opts.modules === 'amd') {
moduleImportExpressions = [amdRequire];
moduleImportExpressions = [this.getAmdRequire(this.moduleNameLiteral)];
} else if (this.file.opts.modules === 'common') {
moduleImportExpressions = [commonJSRequire];
moduleImportExpressions = [this.getCommonJSRequire(this.importedModuleLiteral)];
} else {
var amdTest = this.getAmdTest();
var commonJSTest = this.getCommonJSTest();
var componentTest = this.getComponentTest();
var commonJSOrComponentTest = t.logicalExpression('||', commonJSTest, componentTest);
var umdRequire = t.ifStatement(amdTest,
t.blockStatement([amdRequire]),
t.blockStatement([this.getAmdRequire(this.moduleNameLiteral)]),
t.ifStatement(commonJSOrComponentTest,
t.blockStatement([commonJSRequire]),
t.blockStatement([globalRequire])
t.blockStatement([this.getCommonJSRequire(this.importedModuleLiteral)]),
t.blockStatement([this.getGlobalRequire(this.moduleNameLiteral)])
)

@@ -235,0 +226,0 @@ );

{
"name": "babel-plugin-system-import-transformer",
"version": "1.1.4",
"version": "1.1.5",
"description": "Babel plugin that replaces System.import with the equivalent UMD pattern",

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

# babel-plugin-system-import-transformer
Babel plugin that replaces System.import with the equivalent UMD pattern
[![npm](https://img.shields.io/npm/v/babel-plugin-system-import-transformer.svg)](https://www.npmjs.com/package/babel-plugin-system-import-transformer)
[![npm](https://img.shields.io/npm/dm/babel-plugin-system-import-transformer.svg)](https://www.npmjs.com/package/babel-plugin-system-import-transformer)
[Babel](https://babeljs.io/) plugin that replaces System.import with the equivalent UMD pattern
## Transforms

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