Skip to content

Commit

Permalink
perf(build): optimized build
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnydanu committed Nov 4, 2024
1 parent 18031b9 commit a01e0bb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && NODE_OPTIONS=--max_old_space_size=8192 vite build",
"build": "vue-tsc --noEmit && NODE_OPTIONS=--max_old_space_size=6120 vite build",
"preview": "vite preview --port 5050",
"test": "npm run test:unit",
"test:unit": "vitest --environment jsdom",
Expand Down Expand Up @@ -164,6 +164,7 @@
"eslint": "^8.47.0",
"husky": "^9.1.6",
"hygen": "^6.2.11",
"isolated-vm": "^5.0.1",
"jsdom": "^22.0.0",
"less": "^4.1.3",
"prettier": "^3.0.0",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import markdown from 'vite-plugin-vue-markdown';
import svgLoader from 'vite-svg-loader';
import { configDefaults } from 'vitest/config';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import topLevelAwait from "vite-plugin-top-level-await";
import topLevelAwait from 'vite-plugin-top-level-await';

const baseUrl = process.env.BASE_URL ?? '/';

Expand Down Expand Up @@ -133,7 +133,14 @@ export default defineConfig({
},
optimizeDeps: {
exclude: ['isolated-vm'],
include: ['pdfjs-dist'], // optionally specify dependency name
include: ['pdfjs-dist',
'@vueuse/core',
'lodash',
'monaco-editor',
'@tiptap/vue-3',
'highlight.js',
'vue',
'vue-router'], // optionally specify dependency name
esbuildOptions: {
supported: {
'top-level-await': true,
Expand Down

0 comments on commit a01e0bb

Please sign in to comment.