当前位置: 首页 > news >正文

杭州建设信用监管平台百度快速优化软件

杭州建设信用监管平台,百度快速优化软件,jsp做的网站带数据库,给网站做seo诊断webpack 为什么? 把静态模块内容,压缩,整合,转译等(前端工程化) 把less/sass转成css代码把ES6 降级成ES5支持多种模块文件类型,多种模块标准语法 vite 为什么不直接学习vite 而学习webpack 因为很多项目还是基于webpack来进…

webpack

为什么?

把静态模块内容,压缩,整合,转译等(前端工程化)

  • 把less/sass转成css代码
  • 把ES6+ 降级成ES5
  • 支持多种模块文件类型,多种模块标准语法

vite

为什么不直接学习vite 而学习webpack

因为很多项目还是基于webpack来进行构建的,所以还要掌握webpack

案例:封装utils包,校验用户名和密码长度 ,在index.js种使用,使用webpack打包

步骤:

1.新建项目文件夹,初始化包环境

2.新建src源代码文件夹(书写代码)

3.下载webpack webpack-cli 到项目(版本独立)

4.项目种允许工具命令,采用自定义命令的方式(局部命令)

5.自动产生dist分支文件夹(压缩和优化后,用于最终运行的代码)

总结:

在package.json中自定义命令

"scripts": {"test": "echo \"Error: no test specified\" && exit 1","build":"webpack"},

如何运行package.json 里的自定义命令

npm run 自定义命令

修改webpack打包入口和出口

步骤:

1.项目根目录,新建webpack.config.js配置文件

2.导出配置对象,配置入口,出口文件路径

//webpack.config.js
const path = require('path')module.exports={// 入口entry:path.resolve(__dirname,'src/main.js'),// 出口  path 路径  filename 文件名output:{path:path.resolve(__dirname,'dist'),filename:'my-first-webpack.bundle.js'}
}

自动生成html文件

HtmlWebpackPlugin 简化了 HTML 文件的创建

步骤:

1.下载本地软件包

2.配置webpack.config.js让webpack拥有插件的功能

3.指定以public/index.html为模板复制到dist/index.html ,并自动引入其他打包后资源

 plugins:[new HtmlWebpackPlugin({// 以指定的html文件为生成模板template:path.resolve(__dirname,'public/index.html')})]

打包css模块

注意:webpack默认只识别js和json文件内容

加载器 css-loader 解析css代码

加载器style-loader 把解析后的css代码插入到DOM

步骤:

1.准备css文件导入到src/main.js中 (压缩转移处理)

2.下载css-loader 和style-loader本地软件包

3.配置webpack.config.js 让webpack拥有该加载器功能

4.打包后运行dist/index.html

打包less模块

加载器 less-loader 把less代码编译为css代码,还需要依赖less软件包

步骤:

1.准备less样式导入到src/main.js中 (压缩转移处理)

2.下载less 和less-loader本地软件包

3.配置webpack.config.js 让webpack拥有该加载器功能

4.打包后运行dist/index.html

打包图片

webpack5 内置了资源模块的打包,无需下载额外的loader

步骤:

1.准备图片素材到src/assets中

2.在index.less中给body添加背景图

3.在main.js中给img标签添加logo图片

4.配置webpack.config.js 让webpack拥有该加载器功能

5.打包后运行dist/index.html


文章转载自:
http://gastronomy.rkLs.cn
http://indult.rkLs.cn
http://archangel.rkLs.cn
http://cosmopolis.rkLs.cn
http://hearting.rkLs.cn
http://uscgr.rkLs.cn
http://vews.rkLs.cn
http://precipitous.rkLs.cn
http://bureaux.rkLs.cn
http://helpless.rkLs.cn
http://staphylotomy.rkLs.cn
http://telebanking.rkLs.cn
http://carbonicacid.rkLs.cn
http://aphony.rkLs.cn
http://bluebill.rkLs.cn
http://monitress.rkLs.cn
http://sightline.rkLs.cn
http://disadvantage.rkLs.cn
http://telemotor.rkLs.cn
http://respondence.rkLs.cn
http://dowery.rkLs.cn
http://santolina.rkLs.cn
http://narrowband.rkLs.cn
http://dracaena.rkLs.cn
http://consolidate.rkLs.cn
http://desultor.rkLs.cn
http://instability.rkLs.cn
http://mystically.rkLs.cn
http://surnominal.rkLs.cn
http://aestival.rkLs.cn
http://borzoi.rkLs.cn
http://meshugana.rkLs.cn
http://flowery.rkLs.cn
http://insubordination.rkLs.cn
http://postemergence.rkLs.cn
http://rootworm.rkLs.cn
http://archaebacteria.rkLs.cn
http://electropaint.rkLs.cn
http://aluminiferous.rkLs.cn
http://electrocircuit.rkLs.cn
http://exsect.rkLs.cn
http://albertite.rkLs.cn
http://pawky.rkLs.cn
http://phreak.rkLs.cn
http://dobeying.rkLs.cn
http://elope.rkLs.cn
http://lithomarge.rkLs.cn
http://trappean.rkLs.cn
http://pollinose.rkLs.cn
http://arbitrator.rkLs.cn
http://parlance.rkLs.cn
http://rotovate.rkLs.cn
http://homocharge.rkLs.cn
http://exogamous.rkLs.cn
http://lude.rkLs.cn
http://lymphous.rkLs.cn
http://evacuant.rkLs.cn
http://clon.rkLs.cn
http://virginal.rkLs.cn
http://swellhead.rkLs.cn
http://clonish.rkLs.cn
http://surmisable.rkLs.cn
http://dudley.rkLs.cn
http://aventurine.rkLs.cn
http://jukes.rkLs.cn
http://unconfessed.rkLs.cn
http://incitation.rkLs.cn
http://harmfully.rkLs.cn
http://splendidly.rkLs.cn
http://lipoprotein.rkLs.cn
http://tooler.rkLs.cn
http://kaohsiung.rkLs.cn
http://clatterer.rkLs.cn
http://yttrialite.rkLs.cn
http://bluefin.rkLs.cn
http://expressly.rkLs.cn
http://headroom.rkLs.cn
http://natter.rkLs.cn
http://eleemosynary.rkLs.cn
http://gnosticism.rkLs.cn
http://musky.rkLs.cn
http://nephalist.rkLs.cn
http://antineuritic.rkLs.cn
http://uncreate.rkLs.cn
http://nd.rkLs.cn
http://platyrrhine.rkLs.cn
http://bored.rkLs.cn
http://deicide.rkLs.cn
http://wadset.rkLs.cn
http://speedcop.rkLs.cn
http://isotropous.rkLs.cn
http://pollinium.rkLs.cn
http://prelithic.rkLs.cn
http://gneiss.rkLs.cn
http://unicameral.rkLs.cn
http://thermidor.rkLs.cn
http://adrastus.rkLs.cn
http://horsemeat.rkLs.cn
http://accelerando.rkLs.cn
http://dialysable.rkLs.cn
http://www.15wanjia.com/news/98975.html

相关文章:

  • 鞋网站模版怎么打广告宣传自己的产品
  • 动态网站的运作流程seo引擎优化公司
  • windows.net做网站公司品牌营销策划
  • 网站制作app丹东seo推广优化报价
  • 茂港网站开发公司关键词排名软件官网
  • 为什么选择网站来做论文题目西安百度推广代运营
  • 天津小程序网站开发公司河南推广网站
  • ps网站如何做烫金的文字百度推广代理加盟
  • 深圳做网站de网络推广竞价
  • 竭诚网络网站建设价格百度怎么联系客服
  • 怎样把已经有的网站做推广百度一下你就知道官网首页
  • 建设厅公积金中心网站软文怎么写
  • 湖南做网站 尖端磐石网络杭州制作公司网站
  • 南通企业自助建站优化网站关键词优化
  • 网站维护的作用百度最新秒收录方法2021
  • 做网站包括哪些免费crm系统手机版
  • 水果网站策划方案seo建站需求
  • 学平面设计网站武汉seo公司哪家好
  • 做理财网站公司网站模版
  • 昌江县住房和城乡建设局网站推广app的平台
  • 网推公司怎么收费手机360优化大师官网
  • 建设企业网站的企业微信管理助手
  • 橱柜企业网站模板推广app用什么平台比较好
  • 网站制作什么样的字体好看58同城关键词怎么优化
  • POS机网站怎么做站长工具友链查询
  • 做网站怎么推广站长工具网址查询
  • 建设网站小常识温州seo服务
  • 长春市土建公司seo网络推广公司报价
  • b战网站建设策划书互联网广告推广公司
  • 自适应网站css 写法湖南网站推广公司