{"id":15601820,"url":"https://github.com/wklili/usehtmlapi","last_synced_at":"2025-10-29T06:53:20.008Z","repository":{"id":57388594,"uuid":"140138232","full_name":"WKlili/useHtmlApi","owner":"WKlili","description":"学习webpack与git管理项目开发，并使用分支开发组建","archived":false,"fork":false,"pushed_at":"2018-07-14T09:45:39.000Z","size":304,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-14T16:21:54.774Z","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/WKlili.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":"2018-07-08T04:49:36.000Z","updated_at":"2018-07-14T09:45:41.000Z","dependencies_parsed_at":"2022-09-05T03:20:36.652Z","dependency_job_id":null,"html_url":"https://github.com/WKlili/useHtmlApi","commit_stats":null,"previous_names":["formfittingpants/usehtmlapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WKlili%2FuseHtmlApi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WKlili%2FuseHtmlApi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WKlili%2FuseHtmlApi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WKlili%2FuseHtmlApi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WKlili","download_url":"https://codeload.github.com/WKlili/useHtmlApi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243723607,"owners_count":20337416,"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-10-03T02:26:04.489Z","updated_at":"2025-10-29T06:53:14.931Z","avatar_url":"https://github.com/WKlili.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2\u003e1.git初始化项目 \u003c/h2\u003e\n\u003cp\u003emkdir useHtmlApi\u003c/p\u003e\n\u003cp\u003egit init\u003c/p\u003e\n\u003ch2\u003e2.初始化npm项目环境\u003c/h2\u003e\n\u003cp\u003enpm init\u003c/p\u003e\n\u003ch2\u003e3.提交第一个package.json添加到仓库(git add 可以一次提交多个文件)\u003c/h2\u003e\n\u003cp\u003egit add package.json\u003c/p\u003e\n\u003ch2\u003e4.把文件提交到仓库\u003c/h2\u003e\n\u003cp\u003egit commit -m 'npm init'\u003c/p\u003e\n\u003ch2\u003e5.git status 查看项目当前更改情况\u003c/h2\u003e\n\u003ch2\u003e6.git diff README.md查看更改了那些部分\u003c/h2\u003e\n\u003cp\u003e当git add README.md之后就可以发现下次git commit的提交就可以包括修改过的内容了\u003c/p\u003e\n\u003ch2\u003e7.git reset --hard HEAD^\u003c/h2\u003e\n\u003cp\u003egit reset --hard HEAD^表示回退上一个版本\u003c/p\u003e\n\u003cbr\u003e git reset --hard HEAD^^表示回退上上个版本\n\u003ch2\u003e8.git reset --hard 1094a\u003c/h2\u003e\n\u003cp\u003e回到固定的某个提交版本（如果找不到自己的版本编号了，可以使用git reflog查看每一次的命令）\u003c/p\u003e\n\u003ch2\u003e9.注意本地全局webpack和项目中的webpack版本是否一致。\u003c/h2\u003e\n\u003cp\u003enpx webpack --config webpack.config.js;将根据本地的webpack配置文件进行打包\u003c/p\u003e\n\u003ch2\u003e10.webpack管理资源（loader的使用）\u003c/h2\u003e\n\u003cp\u003ewebpack的配置文件的位置暂时不知道在哪里修改，然后就是寻找文件的位置在include中配置的，cssloader Ok\u003c/p\u003e\n\u003ch2\u003e11.webpack配置多个入口文件\u003c/h2\u003e\n\u003cp\u003e在output中通过变量输出对应的文件名到index.html中(17中已解决)\u003c/p\u003e\n\u003ch2\u003e12.开发环境的搭建\u003c/h2\u003e\n\u003cp\u003e首先在生产环境中加入source map有利于查找问题位置引入 devtool: 'inline-source-map'（还有不同等级的map）\u003c/p\u003e\n\u003cp\u003e使用观察者模式，检查当文件发生改变自动编译输出（使用webpack --watch）唯一问题是浏览器无法热更新\u003c/p\u003e\n\u003cp\u003ewebpack-dev-server用来处理热更新npm 执行webpack-dev-server --open 然后在webpack配置文件中写入devServer\u003c/p\u003e\n\u003cp\u003e要监听的文件（发现更新效率较低，等待时间较长）\u003c/p\u003e\n\u003ch2\u003e13.与服务器合作\u003c/h2\u003e\n\u003ch2\u003e14.热更新,问题是和vue-cli比更新的速度还是非常慢，需要五秒左右，需要解决这个问题\u003c/h2\u003e\n\u003ch2\u003e15.与vue结合，输出模版。需要在插件中配置HtmlWebpackPlugin设置模版文件\u003c/h2\u003e\n\u003ch2\u003e16.解决每次打包时间过长的原因有三点，\u003c/h2\u003e\n\u003cp\u003eresolve需要重新打包的文件，减少loader时间\u003c/p\u003e\n\u003cp\u003e将source-map的类型改为cheap类型大大减少打包时间\u003c/p\u003e\n\u003cp\u003emodel设置为开发者模式，可以减少一定的时间\u003c/p\u003e\n\u003cp\u003e暂时不清楚是否有其他方法！！！！\u003c/p\u003e\n\u003ch2\u003e17.vue的组件实现，es6的语法使用，以及重新加一个git分支，最后合成代码。\u003c/h2\u003e\n\u003cp\u003ehttps://www.cnblogs.com/wonyun/p/6030090.html(html-webpack-plugin详解)\u003c/p\u003e\n\u003cp\u003evue组件之间的值传递\u003c/p\u003e\n\u003cp\u003evue组件之间的事件触发还有input的model的值传递，总的来说都是通过eventloop分发事件\u003c/p\u003e\n\u003ch2\u003e移植到win\u003c/h2\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwklili%2Fusehtmlapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwklili%2Fusehtmlapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwklili%2Fusehtmlapi/lists"}