rollup-plugin-angular-inline
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -68,3 +68,3 @@ 'use strict'; | ||
function inlineTemplate(content, urlResolver) { | ||
return content.replace(/templateUrl:\s*'([^']+?\.html)'/g, function (_m, templateUrl) { | ||
return content.replace(/templateUrl:\s*[`'"]([^`'"]+?\.html)[`'"]/g, function (_m, templateUrl) { | ||
const templateFile = urlResolver(templateUrl); | ||
@@ -71,0 +71,0 @@ const templateContent = fs.readFileSync(templateFile, 'utf-8'); |
@@ -63,3 +63,3 @@ import * as fs from 'fs'; | ||
function inlineTemplate(content, urlResolver) { | ||
return content.replace(/templateUrl:\s*'([^']+?\.html)'/g, function (_m, templateUrl) { | ||
return content.replace(/templateUrl:\s*[`'"]([^`'"]+?\.html)[`'"]/g, function (_m, templateUrl) { | ||
const templateFile = urlResolver(templateUrl); | ||
@@ -66,0 +66,0 @@ const templateContent = fs.readFileSync(templateFile, 'utf-8'); |
{ | ||
"name": "rollup-plugin-angular-inline", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Angular templateUrl and styleUrls inline for Rollup.", | ||
@@ -37,4 +37,4 @@ "main": "dist/index.cjs.js", | ||
"devDependencies": { | ||
"@types/mocha": "^2.2.39", | ||
"@types/node": "^7.0.5", | ||
"@types/mocha": "^2.2.41", | ||
"@types/node": "^7.0.33", | ||
"mocha": "^3.2.0", | ||
@@ -51,2 +51,2 @@ "rimraf": "^2.6.1", | ||
} | ||
} | ||
} |
@@ -0,1 +1,8 @@ | ||
# Warning | ||
This approach will likely produce innaccurate sourcemaps. | ||
A better approach is to inline templates/styles directly in the TypeScript sources, which guarantees sourcemaps will be correctly produced by TypeScript. | ||
Such a build step can be found at https://github.com/filipesilva/angular-quickstart-lib. | ||
# rollup-plugin-angular-inline | ||
@@ -48,2 +55,2 @@ [![Build Status][travis-badge]][travis-badge-url] | ||
[travis-badge]: https://travis-ci.org/filipesilva/rollup-plugin-angular-inline.svg?branch=master | ||
[travis-badge-url]: https://travis-ci.org/filipesilva/rollup-plugin-angular-inline | ||
[travis-badge-url]: https://travis-ci.org/filipesilva/rollup-plugin-angular-inline |
Sorry, the diff of this file is not supported yet
16310
56