Vue 環境搭建

前言

Vue環境安裝搭建,步驟以下css

1.node js 安裝

https://nodejs.org/en/html

node -vvue

配置環境變量
NODE_HOME=D:\Program Files\nodejsnode

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

2.npm 安裝

npm install npm -gios

npm -vweb

cnpm install npm -gvue-cli

npm config ls npm

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

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

相關文章
相關標籤/搜索