diff --git a/index.js b/index.js
index 5a7bd2e..a00b1e8 100644
--- a/index.js
+++ b/index.js
@@ -1,21 +1,21 @@
const fs = require('fs');
-const readText = filename => new Promise(res => fs.readFile(filename, (err, data) => (err ? res(null) : res(data.toString()))));
+const read_text = filename => new Promise(res => fs.readFile(filename, (err, data) => (err ? res(null) : res(data.toString()))));
module.exports = ({ extensions = ['.html', '.svelte'] } = {}) => ({
transform(code, id) {
const extension = extensions.find(extension => id.endsWith(extension));
if (extension) {
- const baseId = id.slice(0, -extension.length);
- const jsId = baseId + '.js';
- const cssId = baseId + '.css';
- return Promise.all([jsId, cssId].map(readText)).then(([js, css]) => {
+ const base_id = id.slice(0, -extension.length);
+ const js_id = base_id + '.js';
+ const css_id = base_id + '.css';
+ return Promise.all([js_id, css_id].map(read_text)).then(([js, css]) => {
if (js) {
- this.addWatchFile(jsId);
+ this.addWatchFile(js_id);
code += `\n\n`;
}
if (css) {
- this.addWatchFile(cssId);
+ this.addWatchFile(css_id);
code += `\n\n`;
}
return code;