Skip to content

Commit

Permalink
Merge pull request #4150 from traPtitech/fix/non-reproducible-build-d…
Browse files Browse the repository at this point in the history
…ue-to-incorrect-manual-chunks

fix: manualChunksの指定が誤っていてビルド再現性がなかった
  • Loading branch information
nokhnaton authored Nov 15, 2023
2 parents 57da490 + ba4cef7 commit 9a2a5a1
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[hljsLangIndex + hljsLangs.length]
if (firstLetter < 'i') {
return 'hljs'
}
Expand Down

0 comments on commit 9a2a5a1

Please sign in to comment.