@hqjs/babel-plugin-patch-angular-fesm5-compiler
Advanced tools
Comparing version 0.0.1 to 0.0.2
29
index.js
@@ -8,2 +8,5 @@ module.exports = function({ types: t }) { | ||
if (node.id.name === 'isStyleUrlResolvable') { | ||
const ifSt = node.body.body.find(child => t.isIfStatement(child)); | ||
if(t.isLogicalExpression(ifSt.test) && t.isReturnStatement(ifSt.consequent)) ifSt.test = ifSt.test.left; | ||
const ret = node.body.body.find(child => t.isReturnStatement(child)); | ||
@@ -13,10 +16,22 @@ ret.argument = t.logicalExpression( | ||
ret.argument, | ||
t.binaryExpression( | ||
'==', | ||
t.memberExpression( | ||
t.identifier('schemeMatch'), | ||
t.identifier('1'), | ||
true | ||
t.logicalExpression( | ||
'||', | ||
t.binaryExpression( | ||
'==', | ||
t.memberExpression( | ||
t.identifier('schemeMatch'), | ||
t.identifier('1'), | ||
true | ||
), | ||
t.stringLiteral('http') | ||
), | ||
t.stringLiteral('http') | ||
t.binaryExpression( | ||
'==', | ||
t.memberExpression( | ||
t.identifier('schemeMatch'), | ||
t.identifier('1'), | ||
true | ||
), | ||
t.stringLiteral('https') | ||
) | ||
) | ||
@@ -23,0 +38,0 @@ ); |
{ | ||
"name": "@hqjs/babel-plugin-patch-angular-fesm5-compiler", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Patch angular dynamic compiler to work without bundling", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,1 +8,4 @@ # babel-plugin-patch-angular-fesm5-compiler | ||
``` | ||
# Transformation | ||
Patch allows to resolve absolute URLs and URLs starting from `http` or `https`. |
Sorry, the diff of this file is not supported yet
11774
40
11