babel-plugin-system-import-transformer
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -16,6 +16,11 @@ 'use strict'; | ||
function isExternalModuleImport(importPath) { | ||
return importPath.indexOf('/') === -1; | ||
function isRelativeImport(importPath) { | ||
// https://nodejs.org/api/modules.html#modules_all_together | ||
return importPath.startsWith('./') || importPath.startsWith('/') || importPath.startsWith('../'); | ||
} | ||
function isNodeModuleImport(importPath) { | ||
return importPath.indexOf('/') === -1 || !isRelativeImport(importPath); | ||
} | ||
function getImportPath(file, relativeImportPath) { | ||
@@ -30,3 +35,3 @@ var filename = file.opts.filename; | ||
// check if it is a relative path or a module name | ||
var importedModulePath = isExternalModuleImport(importPath) ? importPath : getImportPath(file, importPath); | ||
var importedModulePath = isNodeModuleImport(importPath) ? importPath : getImportPath(file, importPath); | ||
@@ -33,0 +38,0 @@ // Use the getModuleName() |
{ | ||
"name": "babel-plugin-system-import-transformer", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Babel plugin that replaces System.import with the equivalent UMD pattern", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23407
282