parcel-vue 一个基于 Parcel 打包工具的 vuejs 急速开发脚手架解决方案, 强烈建议使用 node8.0 以上
项目地址: https://github.com/w3c-king/parcel-vue
初始化项目
- $ Git clone https://github.com/w3c-king/parcel-vue.git
- <h4 > 安装依赖 </h4>
- <pre class="brush:shell">$ cd parce-vue
- $ NPM install
其中
parcel-bundler 是主要的工具, 对于 vue 结尾的单文件, 需要单独处理文件类型,
parcel-plugin-vue 这个插件会通过 vueify 来生成对应的代码, parcel 会自动加载 parcel-plugin 开头的依赖.
运行开发环境, 运行成功后打开浏览器 http://localhost:1234 查看项目
- $ NPM run dev
- <h4 > 打包编译 </h4>
- <pre class="brush:shell">$ 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 就可以进行开发和构建.
Node.JS 版本升级, 如果您的 node 版本低于 8.0, 我们强烈建议您升级 node 版本 (命令行升级不支持 Windows)
- $ NPM install -g n
- $ n stable
- ```
来源: http://www.bubuko.com/infodetail-2846959.html