Skip to content

Commit

Permalink
feat: upgrade vite
Browse files Browse the repository at this point in the history
  • Loading branch information
zzetao committed Jan 21, 2021
1 parent 1378672 commit a771c37
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 1,828 deletions.
1 change: 1 addition & 0 deletions components/ProfileItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</div>
<div class="gif" v-if="profile.hasGif">GIF</div>
<img
src="../assets/card-placeholder.png"
v-lazyload="profile.previewImageUrl"
:alt="profile.nickName"
:style="{ '--image-height': `-${profile.height / 2}px` }"
Expand Down
8 changes: 4 additions & 4 deletions libs/lazyload.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { App } from 'vue'
export default function install(app: App) {
app.directive('lazyload', {
beforeMount(el) {
if (!el.src) {
// placeholder
el.setAttribute('src', 'assets/card-placeholder.png')
}
// if (el.src && el.src.indexOf('placeholder') !== -1) {
// // placeholder
// el.setAttribute('src', 'assets/card-placeholder.png')
// }
},
mounted (el, binding) {
const intersectionObserver = new IntersectionObserver(function(entries) {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
"vue": "^3.0.0-rc.5"
},
"devDependencies": {
"@vitejs/plugin-vue": "^1.1.0",
"@vue/compiler-sfc": "^3.0.0-rc.5",
"less": "^3.12.2",
"vite": "^1.0.0-rc.13"
"vite": "^2.0.0-beta.35"
},
"repository": {
"type": "git",
Expand Down
6 changes: 4 additions & 2 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const fs = require('fs')
const path = require('path')
const vue = require('@vitejs/plugin-vue')

// https://github.com/vitejs/vite/pull/1218
function fixFaviconBugPlugin() {
Expand All @@ -24,6 +25,7 @@ function fixFaviconBugPlugin() {
module.exports = {
assetsDir: 'assets',
plugins: [
fixFaviconBugPlugin()
vue(),
// fixFaviconBugPlugin()
]
}
}
Loading

1 comment on commit a771c37

@vercel
Copy link

@vercel vercel bot commented on a771c37 Jan 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.