fix(build): support nested assetsDir

pull/3220/head
Divyansh Singh 1 year ago
parent b53cda0bc1
commit 02161d0f79

@ -360,7 +360,7 @@ export default {
- Type: `string`
- Default: `assets`
The directory for assets files. See also: [assetsDir](https://vitejs.dev/config/build-options.html#build-assetsdir).
Specify the directory to nest generated assets under. The path should be inside [`outDir`](#outdir) and is resolved relative to it.
```ts
export default {

@ -74,7 +74,7 @@ export async function resolveConfig(
const site = await resolveSiteData(root, userConfig)
const srcDir = normalizePath(path.resolve(root, userConfig.srcDir || '.'))
const assetsDir = userConfig.assetsDir
? userConfig.assetsDir.replace(/\//g, '')
? userConfig.assetsDir.replace(/(^\.?\/|\/$)/g, '')
: 'assets'
const outDir = userConfig.outDir
? normalizePath(path.resolve(root, userConfig.outDir))

Loading…
Cancel
Save