rollup-plugin-license-xml
Advanced tools
Comparing version 0.0.2 to 0.0.3
23
index.js
@@ -48,3 +48,24 @@ 'use strict'; | ||
const templateString = fs.readFileSync(path.join(__dirname, 'template.handlebars'), 'utf8'); | ||
const templateString = ` | ||
{{#each modules}} | ||
<other> | ||
<description>{{this.packageJson.name}}</description> | ||
<locations> | ||
{{#each files}} | ||
{{#if ../truncated}} | ||
<directory>{{this}}</directory> | ||
{{else}} | ||
<file>{{this}}</file> | ||
{{/if}} | ||
{{/each}} | ||
</locations> | ||
<licenses> | ||
<license> | ||
<name>{{this.packageJson.license}}</name> | ||
<url>{{licenseUrl this.packageJson.repository.url}}</url> | ||
</license> | ||
</licenses> | ||
</other> | ||
{{/each}} | ||
`; | ||
Handlebars.registerHelper('licenseUrl', function (url) { | ||
@@ -51,0 +72,0 @@ if (!url) { |
@@ -48,3 +48,24 @@ 'use strict' | ||
const templateString = fs.readFileSync(path.join(__dirname, 'template.handlebars'), 'utf8') | ||
const templateString = ` | ||
{{#each modules}} | ||
<other> | ||
<description>{{this.packageJson.name}}</description> | ||
<locations> | ||
{{#each files}} | ||
{{#if ../truncated}} | ||
<directory>{{this}}</directory> | ||
{{else}} | ||
<file>{{this}}</file> | ||
{{/if}} | ||
{{/each}} | ||
</locations> | ||
<licenses> | ||
<license> | ||
<name>{{this.packageJson.license}}</name> | ||
<url>{{licenseUrl this.packageJson.repository.url}}</url> | ||
</license> | ||
</licenses> | ||
</other> | ||
{{/each}} | ||
` | ||
Handlebars.registerHelper('licenseUrl', function (url) { | ||
@@ -51,0 +72,0 @@ if (!url) { |
{ | ||
"name": "rollup-plugin-license-xml", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Generates a xml with the licenses of your runtime dependencies", | ||
@@ -5,0 +5,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
15614
265