Skip to content

Commit

Permalink
chore: update error format
Browse files Browse the repository at this point in the history
  • Loading branch information
userquin committed Aug 29, 2024
1 parent 3f6cdca commit 7ca6f2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions examples/vue-router/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ const pwaOptions: Partial<VitePWAOptions> = {
},
],
},
/* showMaximumFileSizeToCacheInBytesWarning: true,
workbox: {
maximumFileSizeToCacheInBytes: 12000,
}, */
// showMaximumFileSizeToCacheInBytesWarning: true,
// workbox: {
// maximumFileSizeToCacheInBytes: 12000,
// },
devOptions: {
enabled: process.env.SW_DEV === 'true',
/* when using generateSW the PWA plugin will switch to classic */
Expand Down Expand Up @@ -85,6 +85,7 @@ if (process.env.SW === 'true') {
buildPlugins: {
vite: [virtualMessagePlugin()],
},
// maximumFileSizeToCacheInBytes: 1000,
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function logWorkboxResult(
if (throwMaximumFileSizeToCacheInBytes) {
const entries = buildResult.warnings.filter(w => w.includes('maximumFileSizeToCacheInBytes'))
if (entries.length)
throw new Error(entries.join('\n'))
throw new Error(`\n${entries.map(w => ` - ${w}`).join('\n')}`)
}

const { root, logLevel = 'info' } = viteOptions
Expand Down

0 comments on commit 7ca6f2f

Please sign in to comment.