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

babel-plugin-angular-inline-template

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-angular-inline-template - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

test/fixtures/relative-path/actual.js

10

CHANGELOG.md

@@ -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)

5

package.json
{
"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": {

12

README.md

@@ -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 @@

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