安装webpack 版vue 项目

在指定的目录中打开命令cmd窗口
vue init webpack testvueproject

  1. Project name (回车默认)
  2. Project description (A Vue.js project) 回车默认 (也可以输入自己的描述)
  3. Author 回车默认(自己的名字)
  4. Vue build 默认选择 Runtime+Compiler
  5. Install vue-router?Y 安装
  6. Use ESLint to lint your code? Y (推荐使用,保持良好的代码编写规范)
  7. pick an eslint preset. 默认 Standard
  8. set up unit tests ? n (unit 测试,不需要)
  9. setup e2e tests with Nightwatch?n (e2e 测试,不需要)
  10. Should we run npm install for you after the project has been created? (recom
  11. mended) npm (选用 npm )
    安装webpack 版vue 项目
    安装完毕
    安装webpack 版vue 项目

Vue 运行
在建好的项目目录中执行cmd命令:
npm run dev
Vue build 打包
打包命令
npm run build安装webpack 版vue 项目

运行打包项目
进入dist目录:
cd dist
执行命令:
http-server

相关文章: