Skip to content

Commit

Permalink
Fix vite build
Browse files Browse the repository at this point in the history
  • Loading branch information
aldwin7894 committed Jan 19, 2023
1 parent b2c9adb commit 27b83b6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5,756 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"sass": "^1.57.1",
"tailwindcss": "^3.2.4",
"tailwindcss-animatecss": "^3.0.2",
"terser": "^5.16.1",
"tw-elements": "^1.0.0-alpha13",
"vite": "^4.0.4",
"vite-plugin-full-reload": "^1.0.5",
Expand Down
43 changes: 22 additions & 21 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,29 @@ export default defineConfig({
emptyOutDir: true,
assetsInlineLimit: 24000,
cssCodeSplit: true,
target: "esnext",
target: ["chrome87", "firefox78"],
minify: "terser",
sourcemap: false,
// rollupOptions: {
// output: {
// compact: true,
// manualChunks(id) {
// const chunks = [
// "chart.js",
// "alpinejs",
// "tw-elements",
// "iconify-icon",
// "tailwindcss",
// "@hotwired",
// "@rails",
// ];
rollupOptions: {
output: {
compact: true,
manualChunks(id) {
const chunks = [
"chart.js",
"alpinejs",
"tw-elements",
"iconify-icon",
"tailwindcss",
"@hotwired",
"@rails",
];

// if (chunks.some(x => id.includes(x))) {
// return chunks.find(x => id.includes(x));
// }
// return "vendor";
// },
// },
// },
if (chunks.some(x => id.includes(x))) {
return chunks.find(x => id.includes(x));
}
return "vendor";
},
},
},
},
});
Loading

0 comments on commit 27b83b6

Please sign in to comment.