Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue优化记录 #41

Open
xiaotiandada opened this issue Jan 19, 2021 · 0 comments
Open

vue优化记录 #41

xiaotiandada opened this issue Jan 19, 2021 · 0 comments

Comments

@xiaotiandada
Copy link
Owner

2019-11-21 12:48:47

1.看别人怎么优化的
2.看chrome提示怎么优化

const ImageminPlugin = require('imagemin-webpack-plugin').default
const imageminMozjpeg = require('imagemin-mozjpeg')

// 图片优化
new ImageminPlugin({
  test: /\.(jpe?g|png|gif)$/i,
  plugins: [
    imageminMozjpeg({
      disable: process.env.NODE_ENV !== 'production',
      quality: '65-80',
      progressive: true
    })
  ]
})

提取 CSS 到单个文件-简单的方法

首页

performance 30
Accessibility 78
BestPractices 79
SEO 100

performance

performance 30!

Serve images in next-gen formats

Image formats like JPEG 2000, JPEG XR, and WebP often provide better compression than PNG or JPEG, which means faster downloads and less data consumption. Learn more.

修改了png, 使用webp 利用photoshop插件保存图片

performance 35!

Serve images in next-gen formats(不提示)

但是由于兼容问题, 这里炸了 哈哈哈哈哈哈哈哈😂

... 等待后续

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant