From bf54959ef5dd5b050843da949a36c365b2c50eb3 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Wed, 21 Mar 2018 13:56:16 -0600 Subject: [PATCH 1/3] Fix for template rendering --- services/mailer/templates.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/mailer/templates.js b/services/mailer/templates.js index 59bcdda5a..f20bee974 100644 --- a/services/mailer/templates.js +++ b/services/mailer/templates.js @@ -1,5 +1,5 @@ const path = require('path'); -const fs = require('fs-extra'); +const fs = require('fs'); const { get, set, template } = require('lodash'); // load all the templates as strings @@ -9,13 +9,13 @@ const templates = { }; // Registers a template with the given filename and format. -templates.register = async (filename, name, format) => { +templates.register = (filename, name, format) => { // Check to see if this template was already registered. if (get(templates.registered, [name, format], null) !== null) { return; } - const file = await fs.readFile(filename, 'utf8'); + const file = fs.readFileSync(filename, 'utf8'); const view = template(file); set(templates.registered, [name, format], view); From 881d7abfa615310f99da735dbce22aca3522dd09 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Wed, 21 Mar 2018 13:58:22 -0600 Subject: [PATCH 2/3] replaced fs-extra call to fs --- services/mailer/templates.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/mailer/templates.js b/services/mailer/templates.js index f20bee974..d6871dd20 100644 --- a/services/mailer/templates.js +++ b/services/mailer/templates.js @@ -22,7 +22,7 @@ templates.register = (filename, name, format) => { }; // load the templates per request during development -templates.render = async (name, format = 'txt', context) => { +templates.render = (name, format = 'txt', context) => { // Check to see if the template is a registered template (provided by a plugin // ) and prefer that first. let view = get(templates.registered, [name, format], null); @@ -44,7 +44,7 @@ templates.render = async (name, format = 'txt', context) => { 'templates', [name, format, 'ejs'].join('.') ); - const file = await fs.readFile(filename, 'utf8'); + const file = fs.readFileSync(filename, 'utf8'); view = template(file); if (process.env.NODE_ENV === 'production') { From bf37ab8c784fe230b6fcda53a60d7ace70166ddf Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Wed, 21 Mar 2018 14:14:04 -0600 Subject: [PATCH 3/3] Moved extract-text-webpack-plugin from devDependencies to dependencies --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cb8fc455e..c2cd648e1 100644 --- a/package.json +++ b/package.json @@ -104,6 +104,7 @@ "exports-loader": "^0.6.4", "express": "4.16.0", "express-static-gzip": "^0.3.1", + "extract-text-webpack-plugin": "^3.0.2", "file-loader": "^0.11.2", "form-data": "^2.3.1", "fs-extra": "^4.0.1", @@ -213,7 +214,6 @@ "enzyme-adapter-react-15": "^1.0.0", "eslint": "^4.5.0", "eslint-plugin-mocha": "^4.11.0", - "extract-text-webpack-plugin": "^3.0.2", "husky": "^0.14.3", "identity-obj-proxy": "^3.0.0", "ip": "^1.1.5",