parcel-vue 一个基于 Parcel 打包工具的 vuejs 急速开发脚手架解决方案, 强烈建议使用 node8.0 以上
项目地址: https://github.com/w3c-king/parcel-vue
初始化项目
$ git clone https://github.com/w3c-king/parcel-vue.git
安装依赖
其中 parcel-bundler 是主要的工具,对于 vue 结尾的单文件,需要单独处理文件类型, parcel-plugin-vue 这个插件会通过 vueify 来生成对应的代码,parcel 会自动加载 parcel-plugin 开头的依赖.
$ cd parce-vue
$ npm install
运行开发环境, 运行成功打开浏览器 http://localhost:1234 即可查看项目
$ npm run dev
打包编译
$ npm run build
开发
目录结构
src
├── router
├── index.js
├── assets
├── logo.png
├── components
├── Hello
├── index.js
├── index.js
├── views
├── HelloWorld
├── images
├── logo.png
├── HelloWorld.vue
├── styles
├── common.CSS
├── store
├── global
├── global.js
├── index.js
├── index.js
├── app.vue
├── index.js
只需要执行 npm run dev 和 npm run build 就可以进行开发和构建.
nodejs 版本升级, 如果您的 node 版本低于 8.0, 我们强烈建议您升级 node 版本 (命令行升级不支持 windows)
$ npm install -g n
$ n stable
来源: https://juejin.im/post/5a54ab93f265da3e23665865