diff options
| author | rr- <rr-@sakuya.pl> | 2016-05-21 10:02:06 +0200 |
|---|---|---|
| committer | rr- <rr-@sakuya.pl> | 2016-05-21 10:04:23 +0200 |
| commit | 94a228b1e7531c66ee8ee949a986b8656afc99d8 (patch) | |
| tree | c441f7f92f99d892c273d87a145609b9f2eac11c /client/build.js | |
| parent | 98c61288292e8d1994bd1526cf413f4a24f647e3 (diff) | |
client/build: roll back to underscore
lodash adds extra 50K for no benefit.
Diffstat (limited to 'client/build.js')
| -rw-r--r-- | client/build.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/client/build.js b/client/build.js index 38e8769..5f888d1 100644 --- a/client/build.js +++ b/client/build.js @@ -72,7 +72,7 @@ function minifyHtml(html) { } function bundleHtml(config) { - const lodash = require('lodash'); + const underscore = require('underscore'); const babelify = require('babelify'); const baseHtml = fs.readFileSync('./html/index.htm', 'utf-8'); const finalHtml = baseHtml @@ -83,12 +83,12 @@ function bundleHtml(config) { glob('./html/**/*.tpl', {}, (er, files) => { let compiledTemplateJs = '\'use strict\'\n'; - compiledTemplateJs += 'let _ = require(\'lodash\');'; + compiledTemplateJs += 'let _ = require(\'underscore\');'; compiledTemplateJs += 'let templates = {};'; for (const file of files) { const name = path.basename(file, '.tpl').replace(/_/g, '-'); const templateText = minifyHtml(fs.readFileSync(file, 'utf-8')); - const functionText = lodash.template( + const functionText = underscore.template( templateText, {variable: 'ctx'}).source; compiledTemplateJs += `templates['${name}'] = ${functionText};`; } @@ -114,7 +114,7 @@ function bundleCss() { function bundleJs(config) { const browserify = require('browserify'); const external = [ - 'lodash', + 'underscore', 'superagent', 'mousetrap', 'js-cookie', |