From 94a228b1e7531c66ee8ee949a986b8656afc99d8 Mon Sep 17 00:00:00 2001 From: rr- Date: Sat, 21 May 2016 10:02:06 +0200 Subject: [PATCH] client/build: roll back to underscore lodash adds extra 50K for no benefit. --- client/build.js | 8 ++++---- client/package.json | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/build.js b/client/build.js index 38e8769e..5f888d1e 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', diff --git a/client/package.json b/client/package.json index 83b33ae9..0f97c700 100644 --- a/client/package.json +++ b/client/package.json @@ -17,14 +17,14 @@ "html-minifier": "^1.3.1", "js-cookie": "^2.1.0", "js-yaml": "^3.5.5", - "lodash": "^4.12.0", "merge": "^1.2.0", "mousetrap": "^1.5.3", "nprogress": "^0.2.0", "page": "^1.7.1", "stylus": "^0.54.2", "superagent": "^1.8.3", - "uglify-js": "git://github.com/mishoo/UglifyJS2.git#harmony" + "uglify-js": "git://github.com/mishoo/UglifyJS2.git#harmony", + "underscore": "^1.8.3" }, "devDependencies": { "watch": "latest"