From 79b3e4e125b2596debecfe8bae2f0ed2c65858b4 Mon Sep 17 00:00:00 2001 From: miripiruni Date: Fri, 2 Dec 2016 15:19:06 +0300 Subject: [PATCH] Bundle size metrica (Fix for #366) --- package.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 49833eb1..8af276af 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,13 @@ "make:bemhtml": "browserify --standalone bemhtml lib/bemhtml/index.js -o lib/bemhtml/bundle.js", "make:bemtree": "browserify --standalone bemtree lib/bemtree/index.js -o lib/bemtree/bundle.js", "clean": "rm -f lib/bem{html,tree}/bundle.js", - "test": "npm run make && npm run test:lint && npm run test:coverage", + "test": "npm run make && npm run test:lint && npm run test:coverage && npm run size", "test:lint": "jscs `ls lib/*.js lib/**/*.js test/*.js | grep -v bundle` && jshint `ls lib/*.js lib/**/*.js test/*.js | grep -v bundle`", "test:mocha": "mocha --reporter=spec test/*-test.js", - "test:coverage": "./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha -- -u bdd -R spec test/*-test.js" + "test:coverage": "./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha -- -u bdd -R spec test/*-test.js", + "size": "npm run size:bemhtml && npm run size:bemtree", + "size:bemhtml": "ls -ola ./lib/bemhtml/bundle.js | awk '{print \"BEMHTML Bundle Size:\", $4\" B\"}'", + "size:bemtree": "ls -ola ./lib/bemtree/bundle.js | awk '{print \"BEMTREE Bundle Size:\", $4\" B\"}'" }, "repository": { "type": "git",