Skip to content

Commit

Permalink
fix: manualChunksの指定が誤っていてビルド再現性がなかった
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Nov 15, 2023
1 parent 57da490 commit 69e205b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ export default defineConfig(({ command, mode }) => ({
if (['@traptitech/traq/', 'axios'].some(t => id.includes(t))) {
return 'apis'
}
if (id.includes('node_modules/highlight.js')) {
const hljsLangs = 'node_modules/highlight.js/lib/languages/'
const hljsLangIndex = id.indexOf(hljsLangs)
if (id.includes(hljsLangs)) {
// hljsは適当に二つに分割する
const t = 'node_modules/highlight.js/lib/languages/'
const firstLetter = id.slice(id.indexOf(t) + t.length)[0]
const firstLetter = id.slice(hljsLangIndex + hljsLangs.length)[0]
if (firstLetter < 'i') {
return 'hljs'
}
Expand Down

0 comments on commit 69e205b

Please sign in to comment.