Skip to content

Instantly share code, notes, and snippets.

@IbnSaeed
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IbnSaeed/439f301622205bc5cfd7 to your computer and use it in GitHub Desktop.
Save IbnSaeed/439f301622205bc5cfd7 to your computer and use it in GitHub Desktop.

The package.json above expects .less files to be in style/, browser code to be in browser/, and static files to be in static/.

To watch the less and js files for development, do:

npm run watch

To build for production, do:

npm run build
{
"name": "my-app",
"version": "0.0.0",
"dependencies": {
"browserify": "~2.36.1",
"less": "~1.5.1"
},
"devDependencies": {
"watchify": "~0.4.1",
"catw": "~0.2.0"
},
"scripts": {
"watch-css": "catw -c 'lessc -' 'style/*.less' -o static/bundle.css -v",
"watch-js": "watchify browser/*.js -o static/bundle.js -dv",
"watch": "npm run watch-css & npm run watch-js",
"build-css": "catw -c 'lessc -' 'style/*.less' > static/bundle.css",
"build-js": "browserify browser/*.js > static/bundle.js",
"build": "npm run build-css && npm run build-js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment