@@ -641,32 +641,8 @@ export default defineConfigWithTheme<Config>({
641
641
}
642
642
} ,
643
643
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 ( / @ v u e \/ ( r u n t i m e | s h a r e d | r e a c t i v i t y ) / . test ( id ) ) {
662
- return 'framework'
663
- } else {
664
- return 'app'
665
- }
666
- }
667
- }
668
- }
669
- }
644
+ minify : 'terser' ,
645
+ chunkSizeWarningLimit : Infinity
670
646
} ,
671
647
json : {
672
648
stringify : true
@@ -677,59 +653,3 @@ export default defineConfigWithTheme<Config>({
677
653
reactivityTransform : true
678
654
}
679
655
} )
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
- ! / \. c s s ( $ | \\ ? ) / . 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
- }
0 commit comments