Skip to content

Commit f2e683d

Browse files
committed
fix: update vite manifest path for producdtion
1 parent f1048c2 commit f2e683d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/vite-helpers.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function readManifest () {
1313
return manifest
1414
}
1515
try {
16-
const manifestPath = path.resolve(__dirname, '../public/build/manifest.json')
16+
const manifestPath = path.resolve(__dirname, '../public/build/.vite/manifest.json')
1717
if (fs.existsSync(manifestPath)) {
1818
manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'))
1919
return manifest
@@ -81,15 +81,16 @@ function getViteAssets (entryName) {
8181
function generateTags (assets) {
8282
let cssTags = ''
8383
let jsTags = ''
84-
const isProduction = process.env.NODE_ENV === 'production'
84+
// const isProduction = process.env.NODE_ENV === 'production'
8585

8686
assets.css.forEach(href => {
8787
cssTags += `<link rel="stylesheet" href="${href}">\n`
8888
})
8989

9090
assets.js.forEach(src => {
9191
// All scripts in dev mode should be modules
92-
const typeAttr = !isProduction ? ' type="module"' : ''
92+
// const typeAttr = !isProduction ? ' type="module"' : ''
93+
const typeAttr = ' type="module"'
9394
jsTags += `<script src="${src}"${typeAttr}></script>\n`
9495
})
9596

0 commit comments

Comments
 (0)