Skip to content

Commit b185480

Browse files
committed
bump vitepress + remove no longer necessary chunks config
1 parent d068a4c commit b185480

File tree

3 files changed

+7
-87
lines changed

3 files changed

+7
-87
lines changed

.vitepress/config.ts

Lines changed: 2 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -641,32 +641,8 @@ export default defineConfigWithTheme<Config>({
641641
}
642642
},
643643
build: {
644-
minify: false, //'terser',
645-
chunkSizeWarningLimit: Infinity,
646-
rollupOptions: {
647-
output: {
648-
chunkFileNames: 'assets/chunks/[name].[hash].js',
649-
manualChunks(id, ctx) {
650-
if (id.includes('gsap')) {
651-
return 'gsap'
652-
}
653-
if (id.includes('dynamics.js')) {
654-
return 'dynamics'
655-
}
656-
if (id.includes('plugin-vue:export-helper')) {
657-
return 'framework'
658-
}
659-
const isVendor = moveToVendor(id, ctx)
660-
if (isVendor) {
661-
if (/@vue\/(runtime|shared|reactivity)/.test(id)) {
662-
return 'framework'
663-
} else {
664-
return 'app'
665-
}
666-
}
667-
}
668-
}
669-
}
644+
minify: 'terser',
645+
chunkSizeWarningLimit: Infinity
670646
},
671647
json: {
672648
stringify: true
@@ -677,59 +653,3 @@ export default defineConfigWithTheme<Config>({
677653
reactivityTransform: true
678654
}
679655
})
680-
681-
const cache = new Map<string, boolean>()
682-
683-
/**
684-
* This is temporarily copied from Vite - which should be exported in a
685-
* future release.
686-
*
687-
* @TODO when this is exported by Vite, VitePress should ship a better
688-
* manual chunk strategy to split chunks for deps that are imported by
689-
* multiple pages but not all.
690-
*/
691-
function moveToVendor(id: string, { getModuleInfo }: any) {
692-
if (
693-
id.includes('node_modules') &&
694-
!/\.css($|\\?)/.test(id) &&
695-
staticImportedByEntry(id, getModuleInfo, cache)
696-
) {
697-
return 'vendor'
698-
}
699-
}
700-
701-
function staticImportedByEntry(
702-
id: string,
703-
getModuleInfo: any,
704-
cache: Map<string, boolean>,
705-
importStack: string[] = []
706-
): boolean {
707-
if (cache.has(id)) {
708-
return cache.get(id) as boolean
709-
}
710-
if (importStack.includes(id)) {
711-
// circular deps!
712-
cache.set(id, false)
713-
return false
714-
}
715-
const mod = getModuleInfo(id)
716-
if (!mod) {
717-
cache.set(id, false)
718-
return false
719-
}
720-
721-
if (mod.isEntry) {
722-
cache.set(id, true)
723-
return true
724-
}
725-
const someImporterIs = mod.importers.some((importer: string) =>
726-
staticImportedByEntry(
727-
importer,
728-
getModuleInfo,
729-
cache,
730-
importStack.concat(id)
731-
)
732-
)
733-
cache.set(id, someImporterIs)
734-
return someImporterIs
735-
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"@vue/theme": "^1.0.1",
1111
"dynamics.js": "^1.1.5",
1212
"gsap": "^3.9.0",
13-
"vitepress": "^0.22.1",
13+
"vitepress": "^0.22.2",
1414
"vue": "^3.2.31"
1515
},
1616
"devDependencies": {

pnpm-lock.yaml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)