Skip to content

Commit

Permalink
#19 and #12 bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dangreen committed Nov 9, 2016
1 parent c19cada commit 949a82e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
### 6.0.1:
- [BUGFIX] ````filename` of undefined``` bug fix

### 6.0.0:
- [ENHANCEMENT] [Babel 6 support.](http://babeljs.io/blog/2015/10/29/6.0.0/)
- [ENHANCEMENT] [All Babel 6 options support.](https://babeljs.io/docs/usage/options/)
- [FEATURE] Source map support for stack traces.
* [ENHANCEMENT] [Babel 6 support.](http://babeljs.io/blog/2015/10/29/6.0.0/)
* [ENHANCEMENT] [All Babel 6 options support.](https://babeljs.io/docs/usage/options/)
* [FEATURE] Source map support for stack traces.

### 5.0.1
* [BUGFIX] removed unnecessary console.log
Expand Down
12 changes: 7 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = function(sails) {

// If the hook has been deactivated, just return
if (!config.compile) {
sails.log.verbose("Babel hook deactivated.");
sails.log.verbose('Babel hook deactivated.');
} else {

if (sails.config.environment != 'production') {
Expand All @@ -50,7 +50,9 @@ module.exports = function(sails) {

var fileCache = cache[hash];

if (typeof fileCache == "undefined" || typeof fileCache.options == "undefined" || fileCache.options.filename != file) {
if (typeof fileCache == 'undefined' || typeof fileCache.options == 'undefined'
|| fileCache.options.filename != file
) {
return false;
}

Expand All @@ -68,15 +70,15 @@ module.exports = function(sails) {
}

if (config.polyfill) {
require("babel-polyfill");
require('babel-polyfill');
}

delete config.polyfill;
delete config.compile;

require("babel-register")(config);
require('babel-register')(config);

sails.log.verbose("Babel hook activated. Enjoy ES6/7 power in your Sails app.");
sails.log.verbose('Babel hook activated. Enjoy ES6/7 power in your Sails app.');
}
},
};
Expand Down

0 comments on commit 949a82e

Please sign in to comment.