docs.config.js 635 B

123456789101112131415161718192021222324252627
  1. import baseConfig from './base.config';
  2. import { defineConfig } from 'vite';
  3. import externalGlobals from 'rollup-plugin-external-globals'
  4. export default defineConfig({
  5. ...baseConfig,
  6. base: './',
  7. build: {
  8. outDir: 'docs',
  9. chunkSizeWarningLimit: 1500,
  10. rollupOptions: {
  11. external: ['highlight.js'],
  12. plugins: [
  13. externalGlobals({
  14. 'highlight.js': 'hljs',
  15. }),
  16. ],
  17. output: {
  18. manualChunks(id) {
  19. if (id.includes('node_modules')) {
  20. return id.toString().split('node_modules/')[1].split('/')[0].toString();
  21. }
  22. }
  23. }
  24. }
  25. },
  26. });