Skip to content

Commit

Permalink
chore: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jan 10, 2021
1 parent dc66e75 commit f317dc4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export function VitePWA(options: Partial<VitePWAOptions> = {}): Plugin {
let viteConfig: ResolvedConfig | undefined
let workbox: GenerateSWConfig | undefined
let manifest: Partial<ManifestOptions> = {}
let outDir = 'dist'

return {
name: 'vite-plugin-pwa',
Expand All @@ -19,7 +20,7 @@ export function VitePWA(options: Partial<VitePWAOptions> = {}): Plugin {
const pkg = fs.existsSync('package.json')
? JSON.parse(fs.readFileSync('package.json', 'utf-8'))
: {}
const outDir = options.outDir || config.build.outDir || 'dist'
outDir = options.outDir || config.build.outDir || 'dist'

const defaultWorkbox: GenerateSWConfig = {
swDest: resolve(root, `${outDir}/sw.js`),
Expand Down

0 comments on commit f317dc4

Please sign in to comment.