Added sloc package.

This commit is contained in:
Richard Davey 2017-10-11 17:06:21 +01:00
parent 8cf60b4c3e
commit 0ae15f1a36
2 changed files with 16 additions and 6 deletions

View file

@ -1,7 +1,8 @@
var fs = require('fs-extra');
let fs = require('fs-extra');
let sloc = require('node-sloc');
var source = './dist/phaser.js';
var dest = '../../phaser3-examples/public/build/dev.js';
let source = './dist/phaser.js';
let dest = '../../phaser3-examples/public/build/dev.js';
if (fs.existsSync(dest))
{
@ -14,6 +15,15 @@ if (fs.existsSync(dest))
console.log('Build copied to ' + dest);
const options = {
path: './src',
extensions: [ '.js' ]
};
sloc(options).then((res) => {
console.log('Source files: ' + res.sloc.files + '\nLines of code: ' + res.sloc.sloc);
});
});
}
else

View file

@ -1,6 +1,4 @@
{
"//": "git tag 3.0.0-beta.6",
"//": "git push",
"//": "npm publish --tag beta",
"name": "phaser",
"version": "3.0.0-beta.6",
@ -21,7 +19,8 @@
"scripts": {
"build": "webpack",
"dist": "webpack --config webpack.dist.config.js",
"lint": "eslint --config .eslintrc.json \"src/**/*.js\""
"lint": "eslint --config .eslintrc.json \"src/**/*.js\"",
"sloc": "node-sloc './src' --include-extensions \"js\""
},
"keywords": [
"2d",
@ -38,6 +37,7 @@
"devDependencies": {
"eslint": "^4.3.0",
"fs-extra": "^4.0.0",
"node-sloc": "^0.1.10",
"uglifyjs-webpack-plugin": "^0.4.6",
"uuid": "^3.1.0",
"webpack": "^3.4.1",