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

code-warrior/gulp-template-for-html-css-sass-js: A simple Gulp template for HTML ...

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

开源软件名称(OpenSource Name):

code-warrior/gulp-template-for-html-css-sass-js

开源软件地址(OpenSource Url):

https://github.com/code-warrior/gulp-template-for-html-css-sass-js

开源编程语言(OpenSource Language):

JavaScript 59.3%

开源软件介绍(OpenSource Introduction):

A Set of Gulp v4.0.0 Tasks for Creating Web Projects Using HTML, CSS/Sass, and JavaScript

(v4.0.2)


Installation

Before continuing, make sure Java is installed, as the browser refresh module requires it. Additionally, all the required Node modules need to be installed before you can use this template. From the root folder, type npm install. This will create a folder called node_modules and download the plugins listed under the devDependencies section in the package.json file. If you encounter an ERR! message about EACCES on macOS, then run the command as the super user: sudo npm install.

Tasks

Typing gulp --tasks, or simply gulp, will render a list of tasks included in gulpfile.js. Tasks such as build and serve invoke other tasks and are executed in <series>.

Each task can be run on its own. For example, if all you want to do is validate your HTML, you can type gulp validateHTML.

Running the Project

All your work must be added to the sub-folders under the dev folder: your markup in html, your Sass/CSS in styles, your JavaScript in scripts, and, your images in img.

During development, run gulp serve, which runs multiple development-related tasks, then launches your default browser and reloads on file changes.

For production-ready projects, run build, which creates a folder called prod. This is the folder you’d upload to your server if you were going live with your project.

Issues

As of this writing, 14 Oct 2021, you’ll need to have stylelint installed to run gulp-stylelint, which is included in a task called lintCSS. However, there’s a bug in this project that, when adding the following to the serve task, the browser won’t reload on changes to CSS files.

watch(`dev/styles/**/*.css`, lintCSS)
    .on(`change`, reload);



鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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