{"id":25322723,"url":"https://github.com/qzruncode/sww-cli","last_synced_at":"2025-04-07T22:41:37.432Z","repository":{"id":65549263,"uuid":"441845823","full_name":"qzruncode/sww-cli","owner":"qzruncode","description":"No need to reconfigure webpack, works out of the box","archived":false,"fork":false,"pushed_at":"2022-02-10T07:46:25.000Z","size":849,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T23:47:34.060Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qzruncode.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":"2021-12-26T08:41:55.000Z","updated_at":"2022-01-09T14:05:21.000Z","dependencies_parsed_at":"2023-01-28T19:35:10.608Z","dependency_job_id":null,"html_url":"https://github.com/qzruncode/sww-cli","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/qzruncode%2Fsww-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qzruncode%2Fsww-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qzruncode%2Fsww-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qzruncode%2Fsww-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qzruncode","download_url":"https://codeload.github.com/qzruncode/sww-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247744129,"owners_count":20988779,"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":"2025-02-13T23:47:49.764Z","updated_at":"2025-04-07T22:41:37.398Z","avatar_url":"https://github.com/qzruncode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version](https://img.shields.io/npm/v/sww-cli.svg)](https://www.npmjs.com/package/sww-cli)\n[![NPM package](https://img.shields.io/npm/dy/sww-cli.svg)](https://www.npmjs.com/package/sww-cli)\n\n## sww-cli\n\n1. 基于webpack开发的前端脚手架cli工具，不需要配置webpack，下载此插件安装即可。\n2. 支持react、typescript、less等\n3. 能够将前端的文件打包成合适的大小，避免文件臃肿。\n4. 此插件是本人在开发[cacheweb-webpack-plugin](https://www.npmjs.com/package/cacheweb-webpack-plugin)时配套开发的脚手架工具。\n5. 支持使用模板，配套模板[sww-template](https://www.npmjs.com/package/sww-template)提供开箱即用的配置环境，内置[cacheweb-webpack-plugin](https://www.npmjs.com/package/cacheweb-webpack-plugin)，集成开发所需的各种配置\n\n## 支持的命令\n\n```\nsww --help\nsww run --help 查看run命令的参数\n  -m 指定编译模式 Dev ｜ Pro\n  -url 指定 PUBLIC_URL\n  -c 开启运行时检查\n  -r 开启px转换成rem\n  -H 开启HTTPS\n  -h 设置开发环境的HOST\n\nsww init sww-template 初始化模板\n```\n\n## sww-cli的使用\n\n```js\n\"scripts\": {\n  \"start\": \"sww run -m Dev -h cache.service-worker.com -H -url /\",\n  \"build\": \"sww run -m Pro -url /\",\n}\n```\n\n## 模板的安装\n\n```\ngit init\nnpm install sww-cli\nnpx sww-cli init sww-template\nnpm install\nnpm start 开发\nnpm build 生产\n```\n\n## 插件\n\n```js\n// 在项目根目录新建webpack.plugins.js，在文件中写入\n\nconst cachewebWebpackPlugin = require('cacheweb-webpack-plugin');\nmodule.exports = [\n  new cachewebWebpackPlugin({\n    chacheName: 'SW',\n    expirationHour: 72,\n    maxNum: 0,\n    noCacheFileList: ['index.html', 'register.js'],\n    cacheFirstList: ['cacheFirstTest', 'acacheFirstTes', 'bcacheFirstTes'],\n    permanentCacheList: ['test'],\n  }),\n];\n```\n\n## 使用注意\n\n```\n安装此插件的项目需要配置如下配置文件\n  .browserslistrc\n  .env\n  .eslintrc.js\n  tsconfig.json\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqzruncode%2Fsww-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqzruncode%2Fsww-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqzruncode%2Fsww-cli/lists"}