mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-22 10:46:19 +01:00
web/vite: split transformers.js into separate chunk
This commit is contained in:
parent
8a5b25b4ce
commit
2273bb388f
1 changed files with 3 additions and 0 deletions
|
@ -88,6 +88,9 @@ export default defineConfig({
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
output: {
|
output: {
|
||||||
manualChunks: (id) => {
|
manualChunks: (id) => {
|
||||||
|
if (id.includes('huggingface/transformers'))
|
||||||
|
return 'hf_transformers';
|
||||||
|
|
||||||
if (id.includes('/web/i18n') && id.endsWith('.json')) {
|
if (id.includes('/web/i18n') && id.endsWith('.json')) {
|
||||||
const lang = id.split('/web/i18n/')?.[1].split('/')?.[0];
|
const lang = id.split('/web/i18n/')?.[1].split('/')?.[0];
|
||||||
if (lang) {
|
if (lang) {
|
||||||
|
|
Loading…
Reference in a new issue