front-end-gulp-pattern v1.0.2
front-end-gulp-pattern
gulp-cli wrapper with own read-only gulpfile for front-end.
Provides own gulp-cli binary as font-end-gulp.
Should be configured by package.json.
Usage
Create
package.jsonfile in root of your project;You should set "dependencies", "postinstall" script and "gulp" hash for your
front-end-gulptasks;Minimal example of
package.json:{ "dependencies": { "front-end-gulp-pattern": "^1" }, "scripts": { "postinstall": "./node_modules/.bin/front-end-gulp --production" }, "gulp": { "distclean": [ "./node_modules" ] } }After
npm installfront-end-gulpwill do nothing, but you can run:./node_modules/.bin/front-end-gulp distcleanto remove
node_modulesdirectory;If you're using git then you should add
node_modulesto.gitignore;--productionflag will minify styles and scripts;Also you can use it with web-front-end-deploy as git-submodule, do it in root of your project:
$ git submodule add https://github.com/unclechu/web-front-end-deploy $ ln -s ./web-front-end-deploy/deploy.sh $ mkdir _deploy $ cd _deploy $ ln -s ../web-front-end-deploy/tasks/11-front-end-gulp-pattern_symbolic_link.sh $ ln -s ../web-front-end-deploy/tasks/13-front-end-gulp-pattern_default_tasks.sh $ cd ..And set "postinstall" key in key "scripts" of
package.jsonto: "./deploy.sh".13-front-end-gulp-pattern_default_tasks.shwill do:./node_modules/.bin/front-end-gulp --productionAnd
11-front-end-gulp-pattern_symbolic_link.shwill create symbolic linkfront-end-gulpto./node_modules/.bin/front-end-gulpin root of your project. In this case you should addfront-end-gulpto.gitignoreand to "distclean":{ "dependencies": { "front-end-gulp-pattern": "^1" }, "scripts": { "postinstall": "./deploy.sh" }, "gulp": { "distclean": [ "./node_modules", "./front-end-gulp" ] } }Structure of definition of all tasks in "gulp" key (except "distclean"):
... "task-type": { "own-group-name1": { // params }, "own-group-name2": { // params } } ...
To be continued...
Supported tasks types
- Sprites (spritesmith);
- Styles:
- Stylus;
- Less.
- Scripts:
- Browserify (transforms supported, you can use LiveScript, CoffeeScript, etc.)