原创全新打包工具Parcel零配置VueJS开发脚手架
文章目录
parcel-vue 一个基于Parcel打包工具的 VueJS急速开发脚手架解决方案,强烈建议使用node8.0以上
项目地址: https://github.com/w3c-king/p...
初始化项目
$ git clone https://github.com/w3c-king/parcel-vue.git
安装依赖
$ cd parce-vue
$ npm install
其中parcel-bundler是主要的工具,对于vue结尾的单文件,需要单独处理文件类型,parcel-plugin-vue这个插件会通过vueify来生成对应的代码,parcel会自动加载parcel-plugin开头的依赖。
运行开发环境,运行成功后打开浏览器 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
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论