diff --git a/package.json b/package.json index 40602d0..8c376df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup-plugin-html-scaffold", - "version": "0.1.0", + "version": "0.1.1", "description": "HTML template for Rollup", "keywords": [ "rollup", diff --git a/src/index.js b/src/index.js index 455b2a7..4b65fda 100644 --- a/src/index.js +++ b/src/index.js @@ -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]); }); }