官术网_书友最值得收藏!

Setting up Gulp and Elixir

Elixir is new in Laravel 5.x and is a wrapper around Gulp, which is a well-known JavaScript build system. We will use it to manage assets later on in the book. For now, we just want to get it installed.

How to do it...

  1. SSH into Homestead:
    >homestead ssh
    >cd ~/Code/recipes
  2. Install Gulp using the following:
    >npm install
  3. When it is done, try the following:
    > node_modules/gulp/bin/gulp.js -v

How it works...

Once again, Homestead is making our work easier; NPM is already installed! So, we can use this to not only install Gulp but also other JavaScript libraries that we need. How to do this? If you look into the Laravel application that we downloaded, you will now see the =package.json file:

This is the file that NPM uses, just as PHP uses composer.json, to know what to install. Here, it is getting Elixir, Gulp, and Sass for us. Elixir is new in Laravel 5.x and is a wrapper around Gulp, which is a well-known JavaScript build system.

Notice too that if you type which gulp, it is installed globally, thanks to Homestead again!

Elixir will come in later, but for now, note gulpfile.js that is right above the package.json file; this is where we will set up our asset workflow later on.

See also

主站蜘蛛池模板: 太原市| 阿拉尔市| 巴彦淖尔市| 九寨沟县| 通江县| 新乐市| 本溪市| 武强县| 门头沟区| 达孜县| 灵寿县| 马关县| 商城县| 锡林郭勒盟| 德清县| 修武县| 舒城县| 鄢陵县| 土默特右旗| 交城县| 清原| 增城市| 云梦县| 库伦旗| 扬中市| 北川| 莱州市| 双江| 武陟县| 三江| 拜泉县| 嘉禾县| 沙湾县| 东乡族自治县| 祥云县| 手游| 获嘉县| 平凉市| 永年县| 错那县| 城市|