summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrr- <rr-@sakuya.pl>2016-05-21 10:02:06 +0200
committerrr- <rr-@sakuya.pl>2016-05-21 10:04:23 +0200
commit94a228b1e7531c66ee8ee949a986b8656afc99d8 (patch)
treec441f7f92f99d892c273d87a145609b9f2eac11c
parent98c61288292e8d1994bd1526cf413f4a24f647e3 (diff)
client/build: roll back to underscore
lodash adds extra 50K for no benefit.
-rw-r--r--client/build.js8
-rw-r--r--client/package.json4
2 files changed, 6 insertions, 6 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',
diff --git a/client/package.json b/client/package.json
index 83b33ae..0f97c70 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"