front tools and user vue without vuecli

3. use vue without vuecli

     

npm i webpack 工具

vue-loader  编译vue

css-loader   style-loader    css 加载

vue-template-compiler

html-webpack-plugin   可以直接把生成的js 放到  对应的htiml里

webpack-dev-server    运行网站用

 

babel-loader @babel/core @babel/preset-env    --S7 或 ES8 语法

babel-plugin-syntax-dynamic-import    懒加载
babel-polyfill   支持新的全局变量,例如 Promise 、新的原生方法如 String.padStart (left-pad) 

-D

 

 

npm i 

axios   vue-router vue  element-ui

axios   -S

 

 

 

2  webpack

 

 

1  different of  between yarn   npm

   

npm                                                                                                                                                                                                                                         yarn
npm install       1.放到node_modules 目录中, 2 不修改package.json     3.之后运行npm i 不自动安装                                                                                  yarn
npm install moduleName -g    1.放到全局, 2 不修改package.json     3.之后运行npm i 不自动安装                              
npm install react --save   1.放到node_modules 目录中, 2 修改package.json dependencies     3.之后运行npm i 自动安装                                                         yarn add react
npm uninstall react --save          yarn remove react
npm install react --save-dev   1.放到node_modules 目录中, 2 修改package.json devDependencies 3.之后运行npm i 自动安装                                               yarn add react --dev
npm update --save                       yarn upgrade
npm show vue version  展示安装的版本
 
 
 
 
 
 
install one by one                       install all in the same time 
from the network,                       if had installed, it can install from the cache
                                                    via yarn.lock avoid installing different versions on a different time, or different machine.
                                                    only download from one resource, from npm or bower。
print                                             only print the necessary concise information
 

本地安装
1. 将安装包放在 ./node_modules 下(运行npm时所在的目录)  npm install grunt --save-dev

2. 可以通过 require() 来引入本地安装的包  var grunt = require('grunt');grunt.log.writeln('hello grunt');

全局安装
1. 将安装包放在 /usr/local/bin/modules 下,在/usr/local/bin里做了软连接    npm install -g grunt-cli # 全局安装  
2. 可以直接在命令行里使用

 

 

 

posted on 2020-03-23 17:30  developer1980  阅读(90)  评论(0)    收藏  举报

导航