mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-14 20:53:26 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ec7442f0e1 | |||
| e6f9b28a64 |
@@ -8,6 +8,11 @@ and this project adheres to
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- 🐛(frontend) serve MediaPipe assets under a versioned path
|
||||||
|
- 🐛(frontend) harmonize cache configuration for MediaPipe assets
|
||||||
|
|
||||||
## [1.25.1] - 2026-08-06
|
## [1.25.1] - 2026-08-06
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -65,6 +65,11 @@ server {
|
|||||||
sub_filter_once off;
|
sub_filter_once off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location ^~ /assets/mediapipe/wasm/ {
|
||||||
|
expires 30d;
|
||||||
|
add_header Cache-Control "public, max-age=2592000";
|
||||||
|
}
|
||||||
|
|
||||||
# Serve static files with caching
|
# Serve static files with caching
|
||||||
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||||
expires 30d;
|
expires 30d;
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ server {
|
|||||||
server_tokens off;
|
server_tokens off;
|
||||||
|
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
|
|
||||||
|
location ^~ /assets/mediapipe/wasm/ {
|
||||||
|
expires 30d;
|
||||||
|
add_header Cache-Control "public, max-age=2592000";
|
||||||
|
}
|
||||||
|
|
||||||
# Serve static files with caching
|
# Serve static files with caching
|
||||||
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export const SELFIE_SEGMENTER_MODEL_PATH =
|
|||||||
export const FACE_LANDMARKS_MODEL_PATH =
|
export const FACE_LANDMARKS_MODEL_PATH =
|
||||||
'/assets/mediapipe/models/face_landmarker.task'
|
'/assets/mediapipe/models/face_landmarker.task'
|
||||||
|
|
||||||
export const MEDIAPIPE_PATH_WASM = '/assets/mediapipe/wasm'
|
export const MEDIAPIPE_PATH_WASM = `/assets/mediapipe/wasm/${__MEDIAPIPE_VERSION__}`
|
||||||
|
|
||||||
export enum ProcessorType {
|
export enum ProcessorType {
|
||||||
BLUR = 'blur',
|
BLUR = 'blur',
|
||||||
|
|||||||
Vendored
+4
@@ -1,4 +1,8 @@
|
|||||||
/// <reference types="vite/client" />
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
|
// Version of @mediapipe/tasks-vision, injected at build time (vite.config.ts).
|
||||||
|
declare const __MEDIAPIPE_VERSION__: string
|
||||||
|
|
||||||
interface ImportMetaEnv {
|
interface ImportMetaEnv {
|
||||||
readonly VITE_API_BASE_URL: string
|
readonly VITE_API_BASE_URL: string
|
||||||
readonly VITE_APP_TITLE: string
|
readonly VITE_APP_TITLE: string
|
||||||
|
|||||||
@@ -1,13 +1,27 @@
|
|||||||
|
import { readFileSync } from 'node:fs'
|
||||||
import { defineConfig, loadEnv } from 'vite'
|
import { defineConfig, loadEnv } from 'vite'
|
||||||
import react from '@vitejs/plugin-react'
|
import react from '@vitejs/plugin-react'
|
||||||
import { visualizer } from 'rollup-plugin-visualizer'
|
import { visualizer } from 'rollup-plugin-visualizer'
|
||||||
import svgr from 'vite-plugin-svgr'
|
import svgr from 'vite-plugin-svgr'
|
||||||
import { viteStaticCopy } from 'vite-plugin-static-copy'
|
import { viteStaticCopy } from 'vite-plugin-static-copy'
|
||||||
|
|
||||||
|
const mediapipeVersion: string = JSON.parse(
|
||||||
|
readFileSync(
|
||||||
|
new URL(
|
||||||
|
'./node_modules/@mediapipe/tasks-vision/package.json',
|
||||||
|
import.meta.url
|
||||||
|
),
|
||||||
|
'utf-8'
|
||||||
|
)
|
||||||
|
).version
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig(({ mode }) => {
|
export default defineConfig(({ mode }) => {
|
||||||
const env = loadEnv(mode, process.cwd())
|
const env = loadEnv(mode, process.cwd())
|
||||||
return {
|
return {
|
||||||
|
define: {
|
||||||
|
__MEDIAPIPE_VERSION__: JSON.stringify(mediapipeVersion),
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
react(),
|
react(),
|
||||||
svgr({
|
svgr({
|
||||||
@@ -23,7 +37,7 @@ export default defineConfig(({ mode }) => {
|
|||||||
targets: [
|
targets: [
|
||||||
{
|
{
|
||||||
src: 'node_modules/@mediapipe/tasks-vision/wasm/*',
|
src: 'node_modules/@mediapipe/tasks-vision/wasm/*',
|
||||||
dest: 'assets/mediapipe/wasm',
|
dest: `assets/mediapipe/wasm/${mediapipeVersion}`,
|
||||||
rename: { stripBase: 4 },
|
rename: { stripBase: 4 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,6 +73,11 @@ data:
|
|||||||
sub_filter_once off;
|
sub_filter_once off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location ^~ /assets/mediapipe/wasm/ {
|
||||||
|
expires 30d;
|
||||||
|
add_header Cache-Control "public, max-age=2592000";
|
||||||
|
}
|
||||||
|
|
||||||
# Serve static files with caching
|
# Serve static files with caching
|
||||||
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||||
expires 30d;
|
expires 30d;
|
||||||
|
|||||||
Reference in New Issue
Block a user