• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

akella/gulp4

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

akella/gulp4

开源软件地址(OpenSource Url):

https://github.com/akella/gulp4

开源编程语言(OpenSource Language):

HTML 86.7%

开源软件介绍(OpenSource Introduction):

#How to use

Clone this repo and then in command line type:

  • npm install or yarn - install all dependencies
  • gulp - run dev-server and let magic happen, or
  • gulp build - build project from sources

--

List of Gulp tasks

To run separate task type in command line gulp [task_name]. Almost all tasks also have watch mode - gulp [task_name]:watch, but you don't need to use it directly.

Main tasks

Task name Description
default will start all tasks required by project in dev mode: initial build, watch files, run server with livereload
build:dev build dev version of project (without code optimizations)
build build production-ready project (with code optimizations)

Other tasks

Task name Description
sass compile .sass/.scss to .css. We also use postcss for autoprefixer and Lost, so feel free to include other awesome postcss plugins when needed
webpack compile .js sources into bundle file
copy copy common files from ./src path to ./build path
swig compile swig templates
nunjucks compile Mozilla's awesome nunjucks templates
jade compile jade templates
svgo optimize svg files with svgo
iconfont compile iconfonts from svg sources
sprite:svg create svg symbol sprites (css-tricks)
sprite:png create png sprites
server run dev-server powered by BrowserSync
clean remove ./build folder
list-pages create index file with links to all project pages

This is a full list of tasks, that we use in our projects, but not all of them should be available in current project. For example, we only use one template engine out of these three [jade, nunjucks, swig]. All available tasks are placed in a folder ./gulp/tasks as separate *.js files. Usually, file name = task name.

Flags

We have several useful flags.

  • gulp --open or gulp server --open - run dev server and then open preview in browser
  • gulp --tunnel=[name] or gulp server --tunnel [name] - runs dev server and allows you to easily share a web service on your local development machine (powered by localtunnel.me). Your local site will be available at [name].localtunnel.me.
  • gulp [task_name] --prod or gulp [task_name] --production - run task in production mode. Some of the tasks (like, sass or js compilation) have additional settings for production mode (such as code minification), so with this flag you can force production mode. gulp build uses this mode by default.

##Other You can also use npm scripts:

  • npm run start - same as gulp default.
  • npm run build - same as gulp build.
  • npm run ghpages to push only ./build folder to gh-pages branch on github (very useful for previews).
  • npm run lint - linting javascript with eslint.
  • npm run lint-fix - fix as many issues as possible relatives to eslint settings.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
zce/zce-gulp-demo发布时间:2022-06-21
下一篇:
remko/gulp-hashsum: Gulp plugin to generate checksum files发布时间:2022-06-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap