{"id":22283792,"url":"https://github.com/veaba/gulp-replace-srchash","last_synced_at":"2025-03-25T19:51:56.368Z","repository":{"id":104582153,"uuid":"109146797","full_name":"veaba/gulp-replace-srcHash","owner":"veaba","description":"基于gulp 开发html文件路径哈希值","archived":false,"fork":false,"pushed_at":"2017-11-17T08:47:09.000Z","size":205,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T17:39:45.262Z","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/veaba.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-01T15:11:53.000Z","updated_at":"2017-11-01T15:22:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed83e1c4-8a7d-46ab-a5a9-a77eea2846d0","html_url":"https://github.com/veaba/gulp-replace-srcHash","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/veaba%2Fgulp-replace-srcHash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veaba%2Fgulp-replace-srcHash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veaba%2Fgulp-replace-srcHash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veaba%2Fgulp-replace-srcHash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/veaba","download_url":"https://codeload.github.com/veaba/gulp-replace-srcHash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245535445,"owners_count":20631294,"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-03T16:42:18.485Z","updated_at":"2025-03-25T19:51:56.328Z","avatar_url":"https://github.com/veaba.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gulp-replace-plugins\n基于gulp 开发html文件路径哈希值，对于php等模板引擎，非常好用\n\n## usage\n①  npm install 安装依赖\n```npm\n\tnpm install \n```\n\n②  gulp 任务文件\n```npm\n\tgulp \n```\n## style 文件路径必须为\n\n```html\n\u003clink rel=\"stylesheet\" href=\"css/style.css\"\u003e\n```\n\n如果 为此格式，则会让浏览器无法识别，似乎是gulp 给干掉了：rel=\"stylesheet\n```html\n\u003clink href=\"css/style.css\" rel=\"stylesheet\"\u003e\n```\n\n## html深度设置\n```js\ngulp.src(['*.html','./**/*.html','./**/**/*.html','./**/**/**/*.html','./**/**/**/**/*.html'])\n```\n\n## 支持自定义目录保留不转换功能\n比如保留 plugins 、jquery，不加哈希，以下代码是代码保留plugins不加哈希\n```js\n\n    //plugins ，由于上一个任务带有问号，此处必带问号\n    pipe(replace(/(\\\")*.plugins.*(\\\")|(\\\")*.plugins.*.+(\\\")/g, function (plugins) {\n      console.info('--------Jquery JS----------')\n      console.info(plugins)\n      // return jquery\n      var data = /(\\\")*.plugins(\\S*)(\\?)/g.exec(plugins)\n      //移除最后一个问号\n      if (data) {\n        var str = data[0].replace('?', '')\n        return str + '\"'\n      }\n      return plugins\n    }))\n\n```\n\n\n## 暂时支持替换在源文件,为此请提前备份项目，防止转换失败\n```js\npipe(gulp.dest('./'))\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveaba%2Fgulp-replace-srchash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fveaba%2Fgulp-replace-srchash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveaba%2Fgulp-replace-srchash/lists"}