{"id":20226206,"url":"https://github.com/steamerjs/steamer-gulp","last_synced_at":"2025-04-10T17:06:34.475Z","repository":{"id":57370584,"uuid":"39343751","full_name":"steamerjs/steamer-gulp","owner":"steamerjs","description":null,"archived":false,"fork":false,"pushed_at":"2018-06-08T09:22:57.000Z","size":464,"stargazers_count":23,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T14:46:31.543Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/steamerjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-19T18:12:45.000Z","updated_at":"2025-01-01T07:51:17.000Z","dependencies_parsed_at":"2022-08-29T18:30:57.001Z","dependency_job_id":null,"html_url":"https://github.com/steamerjs/steamer-gulp","commit_stats":null,"previous_names":["steamerteam/steamer-gulp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-gulp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-gulp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-gulp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-gulp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steamerjs","download_url":"https://codeload.github.com/steamerjs/steamer-gulp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248260503,"owners_count":21074211,"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-11-14T07:16:45.295Z","updated_at":"2025-04-10T17:06:34.447Z","avatar_url":"https://github.com/steamerjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 使用\n* 开发模式: gulp\n* 生成dist发布文件: gulp dist\n* 生成离线包: gulp pack\n\n# 功能\n\n* 文件复制\n* 文件压缩\n* 图片压缩\n* 文件md5\n* 文件合并\n* webpack打包及es6特性\n* 代码内联\n* cdn地址\n* 合图\n* 实时刷新\n* 离线包\n* bigpipe模版分割\n* 基本打点 // todo\n* 数据上报代码片段 // todo\n* 自动化测试 // todo\n\n\n# 文件目录\n```\nsrc\n   —— css -- 样式目录\n       —— common -- 公共样式， 不会生成到dev\n       —— sprites -- 合图样式，不会生成到dev\n       —— index -- index页面样式，最终生成index.css\n          —— index.css\n          —— _index_inline.css -- 下划线开头不会被合并\n\n   —— img -- 图片目录\n       —— sprites -- 合图目录\n          —— guide -- 此目录里的图片最终生成guide.png\n\n   —— js  -- js目录\n       —— common -- 公共js， 不会生成到dev\n       —— index -- index页面js，最终生成到index.js\n          —— index.js\n          —— index_other.js\n          —— _index_inline.js 下划线开头不会被合并\n       —— _detail —— detail页面js，最终生成到detail.js\n          —— main.js 入口文件\n          —— main_other.js\n          —— _detail_inline 下划线开头不会被合并\n\n   —— lib -- 第三方库，libs 所有文件会被复制到 dev 目录，js/css 文件名 md5 化\n\n   —— tpl -- 模版文件  // Todo\n      —— common -- 公共模版\n      —— index -- index页面模版\n```\n\n# 用法\n\n## 文件内联\n```\n\u003cscript src=\"/lib/powder.js?___inline\"\u003e\u003c/script\u003e\n\u003clink rel=\"stylesheet\" href=\"/css/all.css?___inline\"\u003e\n\u003ctpl src=\"src/tpl/detail.html?___inline\"\u003e\u003c/tpl\u003e\n```\n在js文件中用html模版，可以这样写:\n```\nvar detailTpl = \"\u003ctpl src=\"src/tpl/detail.html?___inline\"\u003e\u003c/tpl\u003e\"\n```\n具体可以参考https://github.com/lcxfs1991/gulp-inline-src\n\n\n## 静态资源时间戳\n```\n\u003cscript src=\"/lib/powder.js?___timeline\"\u003e\u003c/script\u003e\n\u003clink rel=\"stylesheet\" href=\"/css/all.css?___timeline\"\u003e\n```\n\n## 文件cdn\n\n* script cdn\n```\n\u003cscript src=\"___cdnJs/lib/powder.js?___inline\"\u003e\u003c/script\u003e\n```\n\n* css cdn\n```\n\u003clink rel=\"stylesheet\" href=\"___cdnCss/css/all.css\"\u003e\n```\n\n* img cdn\n\n```\n.icon2{\n\n    background: url(___cdnImg/img/con2.png) no-repeat 50% 0%;\n}\n```\n\n* default cdn\n```\n___cdn\n```\n\n\n## 在css文件中加入另一个css文件内容，开头带下划线的文件不支持，如_index_inline.css\n```\n@import url('./src/css/index.css');\n```\n\n## 下划线js文件夹\n在js文件夹下面带下划线开头的文件夹，如_index，会使用webpack进行文件打包\n\n打包js文件\n```\nvar $ = require('zepto');\n```\n\n## bigpipe模版支持\n具体配置和用法请参考\nhttps://github.com/lcxfs1991/gulp-bigpipe-template\n\n# 配置文件(./steamer/config.js)\n可配置项如下：\n* 基础url\n* cdn路径\n* 文件源及终点\n* 基准文件夹路径（如src, dev, dist等)\n* 文件类型路径 (如js, css等)\n* 字符串匹配，用于各类特殊字符串替换，如cdn，时间戳，内联等\n* webpack配置\n* 是否支持bigpipe模板\n* 是否支持图片压缩\n\n# Changelog\n* 1.1.0 基本功能可使用\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteamerjs%2Fsteamer-gulp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteamerjs%2Fsteamer-gulp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteamerjs%2Fsteamer-gulp/lists"}