1// vite.config.js
2import legacy from '@vitejs/plugin-legacy'
3import { defineConfig } from 'vite'
4
5export default defineConfig({
6 plugins: [
7 legacy({
8 targets: ['defaults', 'not IE 11'],
9 }),
10 ],
11})
1export default function Loading() {
2 return <p>Loading...</p>;
3}
1async function getItem() {
2 // The `fetch` function is automatically memoized and the result
3 // is cached
4 const res = await fetch('https://.../item/1')
5 return res.json()
6}
7
8// This function is called twice, but only executed the first time
9const item = await getItem() // cache MISS
10
11// The second call could be anywhere in your route
12const item = await getItem() // cache HIT
1async function getItem() {
2 // The `fetch` function is automatically memoized and the result
3 // is cached
4 const res = await fetch('https://.../item/1')
5 return res.json()
6}
7
8// This function is called twice, but only executed the first time
9const item = await getItem() // cache MISS
10
11// The second call could be anywhere in your route
12const item = await getItem() // cache HIT
1// vite.config.js
2import legacy from '@vitejs/plugin-legacy'
3import { defineConfig } from 'vite'
4
5export default defineConfig({
6 plugins: [
7 legacy({
8 targets: ['defaults', 'not IE 11'],
9 }),
10 ],
11})
1export default function Loading() {
2 return <p>Loading...</p>;
3}
1// vite.config.js
2import legacy from '@vitejs/plugin-legacy'
3import { defineConfig } from 'vite'
4
5export default defineConfig({
6 plugins: [
7 legacy({
8 targets: ['defaults', 'not IE 11'],
9 }),
10 ],
11})
1gsap.to('.box', {
2 y: 100,
3 stagger: {
4 // wrap advanced options in an object
5 each: 0.1,
6 from: 'center',
7 grid: 'auto',
8 ease: 'power2.inOut',
9 repeat: -1 // Repeats immediately, not waiting for the other staggered animations to finish
10 }
11});