Skip to content

Commit 5044bac

Browse files
committed
Fix CSS loading
1 parent 2065624 commit 5044bac

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: lib/utils.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@ Utils = {
119119
let content = html;
120120

121121
if (template.css) {
122-
const css = Utils.readFile(template.css);
122+
const css = Utils.readFile(template.css, template.packageFolderName);
123123
content = juice.inlineContent(content, css, juiceOpts);
124124
}
125125

126126
if (template.scss) {
127-
const scss = Utils.toCSS(template.scss);
127+
const scss = Utils.toCSS(template.scss, template.packageFolderName);
128128
content = juice.inlineContent(content, scss, juiceOpts);
129129
}
130130

@@ -141,16 +141,16 @@ Utils = {
141141
},
142142

143143
readFile: function(relativePathFromApp, packageFolderName) {
144-
const file = packageFolderName ?
144+
const file = packageFolderName ?
145145
path.join(PACKAGES_ROOT, packageFolderName, relativePathFromApp)
146146
: path.join(ROOT, relativePathFromApp);
147147

148148
try {
149149
return fs.readFileSync(file, {
150150
encoding: 'utf8'
151151
});
152-
153152
} catch (ex) {
153+
Utils.Logger.error(`Could not find file: ${file}, ${ex.message}`, TAG);
154154
throw new Meteor.Error(500, `Could not find file: ${file}`, ex.message);
155155
}
156156
},
@@ -163,7 +163,7 @@ Utils = {
163163
}
164164

165165
const file = packageFolderName ?
166-
path.join(PACKAGES_ROOT, packageName, relativePathFromApp)
166+
path.join(PACKAGES_ROOT, packageFolderName, scss)
167167
: path.join(ROOT, scss);
168168
const sass = Package['chrisbutler:node-sass'].sass;
169169

0 commit comments

Comments
 (0)