{"id":23629775,"url":"https://github.com/willworks/template_project","last_synced_at":"2025-11-08T03:30:33.944Z","repository":{"id":35826341,"uuid":"40109208","full_name":"willworks/template_project","owner":"willworks","description":"基于gulp和npm和scss前端自动构建解决方案","archived":false,"fork":false,"pushed_at":"2016-01-14T14:45:41.000Z","size":2580,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-28T01:18:08.061Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willworks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-03T06:43:57.000Z","updated_at":"2019-08-18T16:49:13.000Z","dependencies_parsed_at":"2022-09-08T17:24:44.230Z","dependency_job_id":null,"html_url":"https://github.com/willworks/template_project","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willworks%2Ftemplate_project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willworks%2Ftemplate_project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willworks%2Ftemplate_project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willworks%2Ftemplate_project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willworks","download_url":"https://codeload.github.com/willworks/template_project/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239547410,"owners_count":19657148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-28T01:18:11.454Z","updated_at":"2025-02-18T20:40:54.905Z","avatar_url":"https://github.com/willworks.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# template_project  \n基于gulp和npm和scss前端自动构建解决方案  \n\n\n## 解决问题  \n - 用scss和原生js编写代码  \n - gulp自动构建，编译scss,压缩css，图片和js，编译出目标文件  \n\n\n## 目录说明  \n \u003e-template_project  \n \u003e\u003e-README 存放说明文件附加图片  \n \u003e\u003e–.git 通过git管理项目会生成这个文件夹  \n \u003e\u003e–node_modules 组件目录  \n \u003e\u003e–dist 发布环境  \n   \u003e\u003e\u003e–css 样式文件(main.min.css)  \n   \u003e\u003e\u003e–img 图片文件(压缩图片)  \n   \u003e\u003e\u003e–js js文件(main.min.js)  \n   \u003e\u003e\u003e–*.html 静态文件\n\n \u003e\u003e–src 生产环境  \n   \u003e\u003e\u003e–scss scss文件  \n   \u003e\u003e\u003e–css css文件 \n   \u003e\u003e\u003e–img 图片文件  \n   \u003e\u003e\u003e–js js文件  \n   \u003e\u003e\u003e–*.html 静态文件  \n\n \u003e\u003e–gulpfile.js gulp任务文件  \n\n\n## 使用方法  \nwindows下边需要用管理员权限执行npm install命令才能成功安装\n\n  - npm install // 安装文件依赖  \n  - gulp // 默认执行全部动作，清理dist文件夹，压缩文件，开启服务器监听\n  - gulp js // 压缩js\n  - gulp css // 压缩css\n  - gulp img // 压缩img\n  - gulp scss // 编译scss，这部分使用较少，独立出来使用\n  - gulp server // 开启监听服务器实现liveReload\n\n  - ![image](https://github.com/willworks/template_project/raw/master/README/build.png)  \n  - gulp server 开启服务器，默认打开入口网页，并且自动监控代码修改并且编译  \n  - ![image](https://github.com/willworks/template_project/raw/master/README/liveReload.png)\n \n\n## 切换淘宝镜像加速  \n - npm http://npm.taobao.org/  \n - npm install -g nrm  \n - nrm use taobao  \n\n\n## 切换node版本nrm  \n - npm install -g nrm  \n - nrm ls //查看node所有版本  \n - nrm use {verision}  \n\n\n## 使用淘宝RubyGems镜像安装sass  \n - 安装ruby，会自动安装gem  \n - gem sources --remove https://rubygems.org/  \n - gem sources -a https://ruby.taobao.org/  \n - gem install sass      \n\n\n## 常见问题  \n - 在项目根目录新建一个文件：.jshintrc(windows用户创建.jshintrc.文件，系统会自动改名.jshintrc)，在此文件里填写你的检查规则  \n - gulp-ruby-sass新的语法能识别路径下的所有文件，不用指定后缀名  \n - 旧版 var cssSrc = './src/scss/*.scss' 新版 var cssSrc = './src/scss/' \n - gulp-clean和gulp-rimraf使用del代替，注意npm https://www.npmjs.com 上包的更新  \n - 注意接口更新，详细参照https://github.com/sindresorhus/gulp-ruby-sass  \n\n\n### 插件语法更新  \nWith the syntax changes in gulp-ruby-sass starting from 1.0.0-alpha, you'll need to use gulp-ruby-sass() instead of gulp.src() to compile your Sass from a file or directory.  \nIf you try to use the original syntax with newer or latest versions, you may encounter the following error:  \nTypeError: Arguments to path.join must be strings  \nFor example, the original syntax in 0.7.x and earlier using gulp.src(), now deprecated:  \n\ngulp-ruby-sass: 0.7.1  \t\n![image](https://github.com/willworks/template_project/raw/master/README/old.png)  \nThe new syntax introduced in 1.x using gulp-ruby-sass() as a gulp source adapter:  \n\ngulp-ruby-sass: 1.x  \n![image](https://github.com/willworks/template_project/raw/master/README/new.png)  \n\n使用browser-sync更新项目替换liveReload","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillworks%2Ftemplate_project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillworks%2Ftemplate_project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillworks%2Ftemplate_project/lists"}