Skip to content

Instantly share code, notes, and snippets.

@enijar
Last active December 28, 2017 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save enijar/0d9632c80dc8439c9163 to your computer and use it in GitHub Desktop.
Save enijar/0d9632c80dc8439c9163 to your computer and use it in GitHub Desktop.
React + Babelify + Watchify with Node Scripts
{
"private": true,
"name": "ReactValidation",
"version": "1.0.0",
"description": "Validates form elements.",
"repository": {
"type": "git",
"url": "git@bitbucket.org:Enijar/reactvalidation.git"
},
"dependencies": {
"react": "^0.14.3",
"react-dom": "^0.14.3"
},
"devDependencies": {
"babelify": "^6.1.3",
"browserify": "^12.0.1",
"browserify-incremental": "^3.0.1",
"nodemon": "^1.3.8"
},
"browserify": {
"transform": [
"babelify"
]
},
"scripts": {
"build": "npm run compile:js && npm run compile:sass",
"watch": "npm run watch:js & npm run watch:sass",
"notify:js": "osascript -e 'display notification \"JavaScript compiled to public/assets/js/bundle.js\" with title \"JavaScript Compiled\"'",
"notify:sass": "osascript -e 'display notification \"CSS compiled to public/assets/js/app.js\" with title \"CSS Compiled\"'",
"compile:js": "browserifyinc -e resources/assets/js/app.js -o public/assets/js/bundle.js --cachefile .browserify-cache.json && npm run notify:js",
"compile:sass": "sass resources/assets/sass/app.scss:public/assets/css/app.css && npm run notify:sass",
"watch:js": "nodemon --watch 'resources/assets/js' --exec 'npm run compile:js'",
"watch:sass": "nodemon --watch 'resources/assets/sass' -e scss --exec 'npm run compile:sass'"
}
}
@enijar
Copy link
Author

enijar commented Dec 2, 2015

Run with npm run watch.

Requires ruby-sass to work and node.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment