Skip to content

Commit

Permalink
chore: add faster buildWatch and static server
Browse files Browse the repository at this point in the history
  • Loading branch information
yoannmoinet committed Nov 8, 2015
1 parent 54b3cff commit e552227
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
test/dist/
17 changes: 17 additions & 0 deletions bin/copyToTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var fs = require('fs');

var mkdirSync = function (path) {
try {
fs.mkdirSync(path);
} catch (e) {
if (e.code != 'EEXIST') {
throw e;
}
}
};

mkdirSync('./test/dist/');

fs
.createReadStream('./dist/nipplejs.js')
.pipe(fs.createWriteStream('./test/dist/nipplejs.js'));
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"main": "./dist/nipplejs.js",
"scripts": {
"postversion": "npm run bowerSync && npm run changelog",
"build": "npm run concat && npm run umd && npm run uglify",
"buildWatch": "npm run concat && npm run umd",
"postbuildWatch": "npm run postBuild && node ./bin/copyToTest.js",
"build": "npm run buildWatch && npm run uglify",
"prebuild": "npm run format && npm run lint",
"postbuild": "node ./bin/clean.js",
"pretest": "npm run build",
Expand All @@ -26,7 +28,8 @@
"changelog": "node ./bin/changelog.js",
"bowerSync": "node ./bin/bowerSync.js",
"uglify": "uglifyjs ./dist/nipplejs.js -o ./dist/nipplejs.min.js -c -m",
"watch": "watch \"npm test\" src test",
"watch": "watch \"npm run buildWatch\" src",
"server": "static test",
"copyGh": "node ./bin/copyToGhPages.js",
"concat": "concat-cli -f ./src/start.js ./src/utils.js ./src/super.js ./src/nipple.js ./src/manager.js ./src/end.js -o ./nipplejs.temp.js"
},
Expand All @@ -38,6 +41,7 @@
"expect.js": "^0.3.1",
"jscs": "^2.1.0",
"mocha": "^2.2.5",
"node-static": "^0.7.7",
"uglify-js": "^2.4.24",
"umd": "^3.0.1",
"watch": "^0.16.0"
Expand Down

0 comments on commit e552227

Please sign in to comment.