Skip to content

Instantly share code, notes, and snippets.

@tadatuta
Created November 12, 2016 22:48
Show Gist options
  • Save tadatuta/5bae68393deb5f5d67f265476ec9eef8 to your computer and use it in GitHub Desktop.
Save tadatuta/5bae68393deb5f5d67f265476ec9eef8 to your computer and use it in GitHub Desktop.
Run enb-closure-compiler-js if YENV=production
diff --git a/.enb/make.js b/.enb/make.js
index bf95ff2..2d49bfc 100644
--- a/.enb/make.js
+++ b/.enb/make.js
@@ -5,6 +5,7 @@ var techs = {
// optimization
borschik: require('enb-borschik/techs/borschik'),
+ closure: require('enb-closure-compiler-js/techs/closure-compiler'),
// css
stylus: require('enb-stylus/techs/stylus'),
@@ -93,10 +94,12 @@ module.exports = function(config) {
}],
// borschik
- [techs.borschik, { source: '?.js', target: '?.min.js', minify: isProd }],
+ [techs.borschik, { source: '?.js', target: (isProd ? '?.borschik.js' : '?.min.js'), minify: false }],
[techs.borschik, { source: '?.css', target: '?.min.css', minify: isProd }]
]);
+ isProd && nodeConfig.addTech([techs.closure, { source: '?.borschik.js', target: '?.min.js' }]);
+
nodeConfig.addTargets([/* '?.bemtree.js', */ '?.html', '?.min.css', '?.min.js']);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment