https://github.com/thecodingmachine/gulp-installer
An installer package that installs Gulp as a Composer dependency.
https://github.com/thecodingmachine/gulp-installer
Last synced: 5 months ago
JSON representation
An installer package that installs Gulp as a Composer dependency.
- Host: GitHub
- URL: https://github.com/thecodingmachine/gulp-installer
- Owner: thecodingmachine
- Created: 2015-04-03T08:20:27.000Z (about 11 years ago)
- Default Branch: 1.0
- Last Pushed: 2015-04-24T13:29:43.000Z (about 11 years ago)
- Last Synced: 2025-10-20T06:24:45.776Z (8 months ago)
- Size: 145 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[Gulp installer for Composer](http://mouf-php.com/packages/mouf/gulp-installer)
=============================
This is an installer that will download [Gulp](http://gulpjs.com/) and install it in your PHP project.
Why?
----
Because Gulp is an extraordinary tool to manage assets (JS, CSS, LESS, SASS, Coffeescript files....) and because
it is not a common tool in the PHP stack.
Gulp is a NodeJS package. Installation is performed using NPM via the [Koala framework's composer extra assets](https://github.com/koala-framework/composer-extra-assets/)
plugin. If NodeJS is not available on your computer, it will be downloaded and installed
locally, thanks to [Mouf's node-installer](https://github.com/koala-framework/composer-extra-assets/) package.
Usage
-----
Simply include this package in your `composer.json` requirements:
**composer.json**
```json
{
"require": {
"mouf/gulp-installer": "~1.0"
}
}
```
Then, you can run Gulp using the `vendor/bin/gulp` script (`vendor\bin\gulp.bat` on Windows).
Most of the time, you will want to install a number of plugins with Gulp. Thanks to
[Koala framework's composer extra assets](https://github.com/koala-framework/composer-extra-assets/), you can add
those dependencies directly into you `composer.json` file.
Sample
------
**composer.json**
```json
{
"require": {
"mouf/gulp-installer": "~1.0"
},
"extra": {
"require-npm": {
"gulp-concat": "~2.4.3",
"gulp-uglify": "~1.1.0",
"gulp-sourcemaps": "~1.3.0",
"gulp-livereload": "~3.7.0",
"gulp-minify-css": "~0.4.5",
"gulp-less": "~3.0.0"
}
}
}
```
A little Composer trick
-----------------------
Lazy about typing "vendor\bin" to run Gulp?
You can also run gulp as a Composer command. For this, you can simply declare a `gulp` in the `scripts` section:
**composer.json**
```json
{
"require": {
"mouf/gulp-installer": "~1.0"
},
"scripts": {
"gulp": "gulp"
}
}
```
Now, you can run gulp using the `composer gulp` command :)
Hey! But that package does not contain anything expect a composer.json file!
----------------------------------------------------------------------------
Yup. Historically, this package used to contain a Composer plugin, but since most of the code used to generate
the link to `gulp` has been put in [Koala framework's composer extra assets](https://github.com/koala-framework/composer-extra-assets/),
this package is reduced to a mere `composer.json`.