Skip to content

Commit

Permalink
chore: normalize assetsDir
Browse files Browse the repository at this point in the history
  • Loading branch information
userquin committed Nov 18, 2023
1 parent bb651d3 commit 0a72583
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { ResolvedConfig } from 'vite'
import type { GenerateSWOptions, InjectManifestOptions } from 'workbox-build'
import type { ManifestOptions, ResolvedVitePWAOptions, VitePWAOptions } from './types'
import { configureStaticAssets } from './assets'
import { resolveBasePath } from './utils'
import { resolveBasePath, slash} from './utils'
import { defaultInjectManifestVitePlugins } from './constants'

function resolveSwPaths(injectManifest: boolean, root: string, srcDir: string, outDir: string, filename: string): {
Expand Down Expand Up @@ -72,7 +72,7 @@ export async function resolveOptions(options: Partial<VitePWAOptions>, viteConfi
const outDirRoot = resolve(root, outDir)
const scope = options.scope || basePath

let assetsDir = viteConfig.build.assetsDir
let assetsDir = slash(viteConfig.build.assetsDir ?? 'assets')
if (assetsDir[assetsDir.length - 1] !== '/')
assetsDir += '/'

Expand Down

0 comments on commit 0a72583

Please sign in to comment.