Skip to content

Commit

Permalink
Merge pull request #80 from bem/issue-79
Browse files Browse the repository at this point in the history
added modules prepend to node.js tech
  • Loading branch information
eGavr committed Oct 20, 2014
2 parents 2ade48f + 661d1a6 commit 6dd01ed
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion app/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"bemtree.js" : "require('enb-bemxjst/techs/bemtree-old')",
"core-bemhtml" : "require('enb-bemxjst/techs/bemhtml-old')",
"bh" : "require('enb-bh/techs/bh-server')",
"node.js" : "require('enb-diverse-js/techs/node-js')",
"pre-node.js" : "require('enb-diverse-js/techs/node-js'), { target: '?.pre.node.js' }",
"node.js" : "require('enb-modules/techs/prepend-modules'), { source: '?.pre.node.js', target: '?.node.js' }",
"pre-browser.js" : "require('enb-diverse-js/techs/browser-js'), { target: '?.pre.js' }",
"browser.js" : "require('enb-modules/techs/prepend-modules'), { source: '?.pre.js', target: '?.js' }",
"html" : "require('enb/techs/html-from-bemjson')"
Expand Down
9 changes: 8 additions & 1 deletion app/lib/enb.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ function getTechnologies(configPath, techs, toMinify, isAutoprefixer) {
inJSON.push('less');
break;

case 'node.js':
inTechs.push(getTechVal('pre-node.js'), getTechVal('node.js'));

inTargets.push(toMinify.indexOf('node.js') > -1 ? 'min.node.js' : 'node.js');

inJSON.push('enb-diverse-js', 'enb-modules');
break;

case 'browser.js':
inTechs.push(getTechVal('pre-browser.js'), getTechVal('browser.js'));

Expand Down Expand Up @@ -188,7 +196,6 @@ function getTechnologies(configPath, techs, toMinify, isAutoprefixer) {

inTargets.push(toMinify.indexOf(tech) > -1 ? 'min.' + tech : tech);

tech === 'node.js' && inJSON.push('enb-diverse-js');
tech === 'bemtree.js' && inJSON.push('enb-bemxjst');
}
});
Expand Down
5 changes: 3 additions & 2 deletions test/fixtures/enb/getTechnologies.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"inTechs": [
"require('enb/techs/files')",
"require('enb/techs/deps')",
"require('enb-diverse-js/techs/node-js')",
"require('enb-diverse-js/techs/node-js'), { target: '?.pre.node.js' }",
"require('enb-modules/techs/prepend-modules'), { source: '?.pre.node.js', target: '?.node.js' }",
"require('enb/techs/css')"
],
"inTargets": ["css", "node.js"],
"inJSON": ["enb-diverse-js"]
"inJSON": ["enb-diverse-js", "enb-modules"]
}
5 changes: 3 additions & 2 deletions test/fixtures/enb/getTechnologies.node.min.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"inTechs": [
"require('enb/techs/files')",
"require('enb/techs/deps')",
"require('enb-diverse-js/techs/node-js')",
"require('enb-diverse-js/techs/node-js'), { target: '?.pre.node.js' }",
"require('enb-modules/techs/prepend-modules'), { source: '?.pre.node.js', target: '?.node.js' }",
"require('enb/techs/css')"
],
"inTargets": ["css", "min.node.js"],
"inJSON": ["enb-diverse-js"]
"inJSON": ["enb-diverse-js", "enb-modules"]
}

0 comments on commit 6dd01ed

Please sign in to comment.