Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(generator): decode path with ufo #9739

Merged
merged 1 commit into from Sep 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/generator/src/generator.js
Expand Up @@ -6,7 +6,7 @@ import fsExtra from 'fs-extra'
import defu from 'defu'
import htmlMinifier from 'html-minifier'
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'

Expand Down Expand Up @@ -353,7 +353,7 @@ or disable the build step: \`generate({ build: false })\``)
// Save Static Assets
if (this.staticAssetsDir && 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.writeFile(assetPath, asset.src, 'utf-8')
}
Expand Down