Skip to content

Commit

Permalink
fix(v0.1.1): replace placeholders with template object
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-aleo committed Feb 28, 2019
1 parent a5a5e6c commit 9485f99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rollup-plugin-html-scaffold",
"version": "0.1.0",
"version": "0.1.1",
"description": "HTML template for Rollup",
"keywords": [
"rollup",
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ export default function htmlTemplate(options = {}) {
readFile(input, (error, buffer) => {
if (error) return reject(error);

const html = buffer.toString('utf8');
let html = buffer.toString('utf8');

if (template) {
Object.keys(template).forEach(key => {
const regex = new RegExp(`<%= +${key} +%>`, 'g');
html.replace(regex, template[key]);
html = html.replace(regex, template[key]);
});
}

Expand Down

0 comments on commit 9485f99

Please sign in to comment.