扩大
缩小

Vue 环境搭建

前言

Vue环境安装搭建,步骤如下

1.node js 安装

https://nodejs.org/en/

node -v

配置环境变量
NODE_HOME=D:\Program Files\nodejs

%NODE_HOME%\;
%NODE_HOME%\node_modules;
%NODE_HOME%\node_global_modules;

2.npm 安装

npm install npm -g

npm -v

cnpm install npm -g

npm config ls

npm config set registry http://registry.cnpmjs.org

npm config set prefix "D:\Program Files\nodejs\node_global_modules"

npm config set cache "D:\Program Files\nodejs\node_cache"

3.webpack 安装

npm install webpack webpack-cli -g
npm install webpack webpack -g

4.vue-cli 安装

npm install vue-cli -g

vue init webpack demo

cd demo

npm run dev

npm run build

5.安装babel

npm install -g babel-cli

npm install babel-preset-es2015 babel-cli --save-dev

npm install babel-loader --save-dev

npm install babel-core --save-dev

 

#npm run compile

https://segmentfault.com/a/1190000008899254

npm init -yes

6.安装 gulp (抛弃,用webpack替代)

npm install -g gulp

npm install gulp -save-dev

7.安装webpack

npm install -g webpack

npm install webpack-cli -g 

npm install webpack webpack-cli -save-dev

 

#CSS

npm install style-loader --save-dev
npm install css-loader --save-dev

#HTML
npm install html-webpack-plugin --save-dev

 

npm install babel-loader @babel/core @babel/preset-env -D

#热更新
npm install webpack-dev-sever --save-dev

webpack --mode development

 

npm install --save axios vue-axios

posted @ 2019-08-15 08:29  戈多编程  阅读(266)  评论(0编辑  收藏  举报