0.0.15 • Published 9 years ago

gulp-pack v0.0.15

Weekly downloads
2
License
ISC
Repository
github
Last release
9 years ago

Gulp-pack

Gulp-pack is a plugin which combines some common gulp plugins to make front-end development easier.

Gulp-pack can do these:

  • simple webserver(webserver)
  • auto-refresh page in browser(livereload)
  • css auto prefix(autoprefixer)
  • css pretreatment(stylus)

More plugins will be combined in the futrue.

Install

Run terminal, and type code as below:

npm install -g gulp-pack

If your network is protected by the GFW, you may wanna try another command:

npm --registry https://registry.npm.taobao.org install -g gulp-pack

Gulp-pack will be installed in global environment, which means, there won't be annoying node_modules folder in your project.

Run

Run terminal, go to your project path, and type code as below:

pack ./

Then you will see comments like these:

D:\Git\test>pack
[10:28:49] Webserver started at http://localhost:3001
watch .js .html
watch .css
507 ms to complete

It means gulp-pack is working.

Optional Parameters

usage: gulp-pack [path] [options]
options:
  -p               Port to use [3001]
  -l --livereload  Livereload Port to use [4001]
  -h --help        Print this list and exit.
  -v --version     Print version.

Extented package.json

You can add properties is package.json to enable/disable some functions.

PropertyEffectOptional ConfigDefault
httpweb server porttrue/falsetrue
livereloadauto refresh page in browsertrue/falsetrue
autoprefixercss auto prefixtrue/falsetrue
openopen browser when server startstrue/falsefalse
stylusmonitor .styl filestrue/falsetrue
watchfile path to be monitoredsee samples as below

If you don't modify package.json, gulp-pack works under default configs.

Here is a sample of package.json:

{
  "name": "my-project",
  "version": "1.0.0",
  "description": "",
  "author": "",


  "pack": {
    "root": "./",
    "http": 3001,
    "livereload": {
      "port": 4001,
      "enable": true
    },
    "autoprefixer": false,
    "open": false,
    "watch": {
      "js": [
        "./client/**/*.js"
      ],
      "css": [
        "./client/**/*.css"
      ],
      "stylus": [
        "./client/**/*.styl"
      ],
      "html": [
        "./client/**/*.html"
      ]
    }
  }


}
0.0.15

9 years ago

0.0.14

9 years ago

0.0.13

9 years ago

0.0.12

9 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago