Mac下构建Vue项目

2021-04-04  本文已影响0人  放肆的桃子
npm install -g webpack
npm install vue-cli -g #cd到想要建立vue项目的目录,安装全局vue-cli
vue init webpack vue-first-demo #init项目
image.png
yarn
yarn install
yarn install --flat ##安装一个且只有一个版本的包
yarn install --force ##强制加载获取所有的包
yarn install --production ## 只会安装dependencies, 不会安装devDependencies
yarn dev
yarn add --dev to add to devDependencies 
yarn add --peer to add to peerDependencies
yarn add --optional to add to optionalDependencies

dependencies: 正常的运行过程中的依赖; devDependencies: 开发模式 所用的依赖; peerDependencies: 当你发布项目的时候 可以指定该依赖; optionalDependencies: 可有可无,表示在安装失败的时候一个备选的依赖保证过程; bundleDependencies: 发布项目的时候所用的依赖 不是从npm来的 一起打包发布到npm上

http-server dist
上一篇下一篇

猜你喜欢

热点阅读