diff --git a/packages/generator/src/generator.js b/packages/generator/src/generator.js index 9ce2cfae3d..aaae213670 100644 --- a/packages/generator/src/generator.js +++ b/packages/generator/src/generator.js @@ -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' @@ -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') }