知乎vue
我的博客node
Githubwebpack
Node官网下载 git
建议安装在非系统盘的英文目录下github
Node
环境配置web
新建文件夹 --- node_cache
和 node_global
(npm install -g package-name
)npm
建立完文件后,须要更改 npmrc
中的 perfix
和 cache
bash
npm config set prefix "E:\Program Files (x86)\Nodejs\node_global"
npm config set cache "E:\Program Files (x86)\Nodejs\node_cache"
复制代码
你须要替换你的安装目录测试
npm run -g vue
vue -V
复制代码
Vue
项目vue init webpack project-name
复制代码
Vue
项目配置
config/index.js
--> build
--> assetsPublicPath
--> /
--> ./
ui
build/webpack.prod.conf.js
--> new HtmlWebpackPlugin
--> removeAttributeQuotes
--> true
--> false
.gitignore
--> 注释/dist/
npm run build
复制代码
在使用http-server前,须要安装 npm i -g http-server
http-server ./dist
复制代码
Github
项目
Vue
项目
Push
到
Github官网
git init
git add .
git commit -m 'init vue project'
git remote add origin git@github.com:Rain120/demo.git
git pull origin master --allow-unrelated-histories
git push -u origin master
复制代码
Github Setting
-- 配置
Github page
Settings
https://rain120.github.io/demo/dist/
,能够看到部署上线的效果(这个仓库我会在演示完后删掉,请自行测试)