mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: add first-class support for CJK (#8530)
This commit is contained in:
parent
21815fb930
commit
b479f3bd65
288 changed files with 3559 additions and 918 deletions
|
@ -25,8 +25,14 @@ export default defineConfig({
|
|||
output: {
|
||||
assetFileNames(chunkInfo) {
|
||||
if (chunkInfo?.name?.endsWith(".woff2")) {
|
||||
// TODO: consider splitting all fonts similar to Xiaolai
|
||||
// fonts don't change often, so hash is not necessary
|
||||
// put on root so we are flexible about the CDN path
|
||||
return "[name]-[hash][extname]";
|
||||
if (chunkInfo.name.includes("Xiaolai")) {
|
||||
return "[name][extname]";
|
||||
} else {
|
||||
return "[name]-[hash][extname]";
|
||||
}
|
||||
}
|
||||
|
||||
return "assets/[name]-[hash][extname]";
|
||||
|
@ -75,17 +81,21 @@ export default defineConfig({
|
|||
},
|
||||
|
||||
workbox: {
|
||||
// Don't push fonts, locales and wasm to app precache
|
||||
globIgnores: ["fonts.css", "**/locales/**", "service-worker.js", "**/*.wasm-*.js"],
|
||||
// don't precache fonts, locales and separate chunks
|
||||
globIgnores: ["fonts.css", "**/locales/**", "service-worker.js", "**/*.chunk-*.js"],
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: new RegExp("/.+.(ttf|woff2|otf)"),
|
||||
handler: "CacheFirst",
|
||||
urlPattern: new RegExp(".+.woff2"),
|
||||
handler: 'CacheFirst',
|
||||
options: {
|
||||
cacheName: "fonts",
|
||||
cacheName: 'fonts',
|
||||
expiration: {
|
||||
maxEntries: 50,
|
||||
maxAgeSeconds: 60 * 60 * 24 * 90, // <== 90 days
|
||||
maxEntries: 1000,
|
||||
maxAgeSeconds: 60 * 60 * 24 * 90, // 90 days
|
||||
},
|
||||
cacheableResponse: {
|
||||
// 0 to cache "opaque" responses from cross-origin requests (i.e. CDN)
|
||||
statuses: [0, 200],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -111,10 +121,10 @@ export default defineConfig({
|
|||
},
|
||||
},
|
||||
{
|
||||
urlPattern: new RegExp(".wasm-.+.js"),
|
||||
urlPattern: new RegExp(".chunk-.+.js"),
|
||||
handler: "CacheFirst",
|
||||
options: {
|
||||
cacheName: "wasm",
|
||||
cacheName: "chunk",
|
||||
expiration: {
|
||||
maxEntries: 50,
|
||||
maxAgeSeconds: 60 * 60 * 24 * 90, // <== 90 days
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue