A Vue.js project 在安居宝做的
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
For detailed explanation on how things work, consult the docs for vue-loader.
1 、npm i -g vue-cli 安装vue-cli
2 、vue init webpack filename vue-cli的脚手架指令 会帮你初始化项目目录
3 、cd filename
4 、Npm install 安装依赖
5 、Npm run dev 在热加载中运行我们的应用 这一行命令代表着它会去找到package.json的scripts对象,
执行node bulid/dev-server.js。在这文件里,配置了Webpack,会让它去编译项目文件,并且运行服务器,
我们在localhost:8080即可查看我们的应用。
6、 npm i vue-resource vue-router --save
参考
https://github.com/vuejs/vue-cli
https://github.com/vuejs-templates/webpack
http://www.imooc.com/article/details/id/6991 Vue构建单页应用最佳实战
https://segmentfault.com/a/1190000004222334#articleHeader2