babel-plugin-angular-inline-template
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="1.1.0"></a> | ||
# [1.1.0](https://github.com/assisrafael/babel-plugin-angular-inline-template/compare/v1.0.1...v1.1.0) (2017-07-14) | ||
### Features | ||
* using relative templateUrl's if a basePath isn't specified (#1) ([2a692d8](https://github.com/assisrafael/babel-plugin-angular-inline-template/commit/2a692d8)) | ||
<a name="1.0.1"></a> | ||
@@ -7,0 +17,0 @@ ## [1.0.1](https://github.com/assisrafael/babel-plugin-angular-inline-template/compare/v1.0.0...v1.0.1) (2017-02-22) |
{ | ||
"name": "babel-plugin-angular-inline-template", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Babel plugin for inlining templates into angular 1.X components and directives", | ||
@@ -15,2 +15,5 @@ "main": "src/index.js", | ||
"author": "Igor Rafael <igor.rafael@gmail.com>", | ||
"contributors": [ | ||
"Dieter Geerts <dieter@dworks.be> https://www.linkedin.com/in/dieteratwork/" | ||
], | ||
"license": "MIT", | ||
@@ -17,0 +20,0 @@ "dependencies": { |
@@ -20,2 +20,12 @@ # babel-plugin-angular-inline-template [![Build Status](https://travis-ci.org/assisrafael/babel-plugin-angular-inline-template.svg?branch=master)](https://travis-ci.org/assisrafael/babel-plugin-angular-inline-template) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/assisrafael/babel-plugin-angular-inline-template/master/LICENSE) | ||
} | ||
``` | ||
``` | ||
Or if you want to use relative templateUrl's: | ||
```json | ||
{ | ||
plugins: [ | ||
'babel-plugin-angular-inline-template' | ||
] | ||
} | ||
``` |
@@ -32,7 +32,6 @@ require('better-log/install'); | ||
ObjectProperty(nodePath, state) { | ||
const basePath = state.opts.basePath; | ||
if (!basePath) { | ||
throw new Error('babel-plugin-angular-inline-template requires a base path to run'); | ||
} | ||
// If basePath isn't specified, use the abs. file folder as base path, | ||
// to have the ability to work with relative templateUrl's | ||
const basePath = state.opts.basePath || state.file.opts.filename.split('/').slice(0, -1).join('/'); | ||
@@ -43,2 +42,2 @@ replaceTemplateUrlWithTemplate(nodePath.node, basePath); | ||
}; | ||
}; | ||
}; |
@@ -30,10 +30,19 @@ 'use strict'; | ||
var exitCode = 0; | ||
var output = babel.transformFileSync(dir.path + '/actual.js', { | ||
plugins: [ | ||
[pluginPath, { | ||
basePath: 'test/fixtures' | ||
}] | ||
] | ||
}); | ||
if (dir.path === path.join(__dirname, 'fixtures', 'relative-path')) { | ||
var output = babel.transformFileSync(dir.path + '/actual.js', { | ||
plugins: [ | ||
pluginPath | ||
] | ||
}); | ||
} else { | ||
var output = babel.transformFileSync(dir.path + '/actual.js', { | ||
plugins: [ | ||
[pluginPath, { | ||
basePath: 'test/fixtures' | ||
}] | ||
] | ||
}); | ||
} | ||
var expected = fs.readFileSync(dir.path + '/expected.js', 'utf-8'); | ||
@@ -40,0 +49,0 @@ |
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
7404
16
119
31