Skip to content

Commit

Permalink
fix option to disable bable register on runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
magalhas committed Mar 28, 2015
1 parent c4a5d48 commit 211b323
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.log
node_modules/
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
'use strict';

var React = require('react');
var merge = require('lodash.merge');
var defaults = require('lodash.defaults');
var path = require('path');

module.exports = function engineFactory (engineOptions) {
engineOptions = merge(engineOptions || {}, {
engineOptions = defaults(engineOptions || {}, {
extension: '.jsx',
babel: {},
docType: '<!DOCTYPE html>',
staticMarkup: false
});

require('babel/register')(engineOptions.babel);
if (engineOptions.babel) {
require('babel/register')(engineOptions.babel);
}

return function renderComponent (filename, options, callback) {
options = options || {};
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"react": "^0.13.1"
},
"dependencies": {
"lodash.merge": "^3.0.2",
"babel": "^4.7.16"
"babel": "^4.7.16",
"lodash.defaults": "^3.1.0"
},
"devDependencies": {
"react": "^0.13.1"
Expand Down

0 comments on commit 211b323

Please sign in to comment.