mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
fix(generator): decode path with ufo
(#9739)
This commit is contained in:
parent
dc0e1b9ad7
commit
dfcc26e3b7
@ -6,7 +6,7 @@ import fsExtra from 'fs-extra'
|
|||||||
import defu from 'defu'
|
import defu from 'defu'
|
||||||
import htmlMinifier from 'html-minifier'
|
import htmlMinifier from 'html-minifier'
|
||||||
import { parse } from 'node-html-parser'
|
import { parse } from 'node-html-parser'
|
||||||
import { withTrailingSlash, withoutTrailingSlash } from 'ufo'
|
import { withTrailingSlash, withoutTrailingSlash, decode } from 'ufo'
|
||||||
|
|
||||||
import { isFullStatic, flatRoutes, isString, isUrl, promisifyRoute, urlJoin, waitFor, requireModule } from '@nuxt/utils'
|
import { isFullStatic, flatRoutes, isString, isUrl, promisifyRoute, urlJoin, waitFor, requireModule } from '@nuxt/utils'
|
||||||
|
|
||||||
@ -353,7 +353,7 @@ or disable the build step: \`generate({ build: false })\``)
|
|||||||
// Save Static Assets
|
// Save Static Assets
|
||||||
if (this.staticAssetsDir && renderContext.staticAssets) {
|
if (this.staticAssetsDir && renderContext.staticAssets) {
|
||||||
for (const asset of renderContext.staticAssets) {
|
for (const asset of renderContext.staticAssets) {
|
||||||
const assetPath = path.join(this.staticAssetsDir, decodeURI(asset.path))
|
const assetPath = path.join(this.staticAssetsDir, decode(asset.path))
|
||||||
await fsExtra.ensureDir(path.dirname(assetPath))
|
await fsExtra.ensureDir(path.dirname(assetPath))
|
||||||
await fsExtra.writeFile(assetPath, asset.src, 'utf-8')
|
await fsExtra.writeFile(assetPath, asset.src, 'utf-8')
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user