您的位置:首页 > Web前端 > Webpack

vue webpack初始化项目(vue init webpack my-project )参数详解

2019-08-15 10:07 513 查看
原文链接:https://blog.csdn.net/AYKMe/article/details/84646571

下载安装node

node官网 注: 

建议下载长期支持版

查看node及npm版本

[code]node -v
npm -v

安装 
@vue/cli-init

[code]npm i -g @vue/cli
npm i -g @vue/cli-init

 vue初始化基于webpack的my-project项目(项目名不能用大写字母)

[code]vue init webpack my-project
[code]? Project name my-project
? Project description A Vue.js project
? Author uplyw <xxx@xxx.com>
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? No
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recommended) npm

1.项目名称,如果不需要就直接回车。注:

此处项目名不能使用大写
。 

[code]Project name (my-project):

2.项目描述,如果不需要就直接回车

[code]Project description (A Vue.js project):

3.项目作者,默认计算机用户名

[code]Author (xxx):

4.构建方式(暂且这么解释

两个选择(上下箭头选择,回车即为选定)建议选择 : 

Runtime + Compiler:recommended for most users

这里推荐使用1选项,适合大多数用户的

[code]vue build (Use arrow keys)
// 1. (译:运行+编译:被推荐给大多数用户)
> Runtime + Compiler:recommended for most users

// 2.(译:只运行大约6KB比较轻量的压缩文件,但只允许模板(或任何VUE特定HTML)。
//	VUE文件需要在其他地方呈现函数。翻译不精准,意思大概是选择该构建方式对文件大小有要求)
> Runtime-only:about 6KB lighter min+gzip,but templates (or any Vue-specific HTML) are ONLY
allowed in .vue files-render functions are required elsewhere

5.安装vue的路由插件,需要就选y,否则就n

建议 : Y

[code]install vue-router?

6.是否使用ESLint检测你的代码?

ESLint 是一个语法规则和代码风格的检查工具,可以用来保证写出语法正确、风格统一的代码。
建议选择 ‘N’ 因为选择 ‘Y’ 在做调试项目时,控制台会有很多 黄色警告 提示格式不规范,但其实并不影响项目

[code]Use ESLint to lint your code?

7.是否安装单元测试(暂不详细介绍)

建议 : N

 8.是否安装E2E测试框架NightWatch(E2E,也就是End To End,就是所谓的“用户真实场景”。)

建议 : 

N
 

[code]Setup e2e tests with Nightwatch(Y/n)?

 9.项目创建后是否要为你运行“npm install”?这里选择包管理工具

选项有三个(上下箭头选择,回车即为选定)建议 : 

yes use npm

[code]Should we run 'npm install' for you after the project has been created?

// 使用npm
yes,use npm

// 使用yarn
yes,use yarn

// 自己操作
no,I will handle that myself

 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: