Skip to content
This repository was archived by the owner on Jan 22, 2021. It is now read-only.

Commit fc6a41e

Browse files
authored
Merge pull request #72 from oakworks/master
Updated for meteor 1.3 / 1.4 closes #71
2 parents 69d6b0e + 271b324 commit fc6a41e

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

lib/utils.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const productionPrivateDir = () => {
3838
return fs.realpathSync(meteorRoot + '/../');
3939
};
4040

41-
const privateDir = process.env.BUNDLE_PATH || process.env.APP_DIR || productionPrivateDir();
41+
const privateDir = process.env.BUNDLE_PATH || productionPrivateDir();
4242

4343
let ROOT = privateDir && path.join(privateDir, 'programs', 'server', 'assets', 'app');
4444

@@ -147,13 +147,20 @@ Utils = {
147147

148148
// Take a path to a SCSS file and compiles it to CSS with `node-sass`.
149149
toCSS: function(scss) {
150-
if (!Package['chrisbutler:node-sass']) {
150+
let sass;
151+
let meteorMinorVersionPosition = 1;
152+
let minorVersion = Meteor.release.split('.')[meteorMinorVersionPosition];
153+
// since meteor 1.3 we no longer need meteor hacks just use the npm version
154+
if (minorVersion >= 3){
155+
sass = require('node-sass');
156+
} else if (!Package['chrisbutler:node-sass']) {
157+
sass = Package['chrisbutler:node-sass'].sass;
158+
} else {
151159
Utils.Logger.warn('Sass support is opt-in since lookback:[email protected]. Please add chrisbutler:node-sass from Atmosphere and try again.', TAG);
152160
return Utils.readFile(scss);
153161
}
154162

155163
const file = path.join(ROOT, scss);
156-
const sass = Package['chrisbutler:node-sass'].sass;
157164

158165
try {
159166
return sass.renderSync({

package.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ var where = 'server';
44
Package.describe({
55
name: 'lookback:emails',
66
summary: 'Send HTML emails with server side Blaze templates. Preview and debug in the browser.',
7-
version: '0.7.4',
7+
version: '0.7.5',
88
git: 'https://github.com/lookback/meteor-emails.git'
99
});
1010

1111
Npm.depends({
12-
'html-to-text': '1.3.0'
12+
'html-to-text': '1.3.0',
13+
'node-sass': '3.8.0'
1314
});
1415

1516
Package.onUse(function(api) {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lookback-emails",
3-
"version": "0.7.4",
3+
"version": "0.7.5",
44
"description": "`lookback:emails` is a Meteor package that makes it easier to build, test and debug rich HTML emails.",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)