mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
fix: fix issues with url handling (#8494)
This commit is contained in:
parent
d85f4b9264
commit
a25bdd622d
@ -10,7 +10,7 @@
|
||||
"index.d.ts"
|
||||
],
|
||||
"dependencies": {
|
||||
"@nuxt/ufo": "^0.1.0",
|
||||
"@nuxt/ufo": "^0.5.0",
|
||||
"@nuxt/utils": "2.14.11",
|
||||
"consola": "^2.15.0",
|
||||
"create-require": "^1.1.1",
|
||||
|
@ -8,7 +8,7 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@nuxt/ufo": "^0.1.0",
|
||||
"@nuxt/ufo": "^0.5.0",
|
||||
"consola": "^2.15.0",
|
||||
"fs-extra": "^8.1.0",
|
||||
"hash-sum": "^2.0.0",
|
||||
|
@ -13,7 +13,7 @@
|
||||
"index.d.ts"
|
||||
],
|
||||
"dependencies": {
|
||||
"@nuxt/ufo": "^0.1.0",
|
||||
"@nuxt/ufo": "^0.5.0",
|
||||
"node-fetch": "^2.6.1",
|
||||
"unfetch": "^4.2.0",
|
||||
"vue": "^2.6.12",
|
||||
|
@ -1,6 +1,6 @@
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
import { normalizeURL } from '@nuxt/ufo'
|
||||
import { normalizeURL, decode } from '@nuxt/ufo'
|
||||
import { interopDefault } from './utils'<%= isTest ? '// eslint-disable-line no-unused-vars' : '' %>
|
||||
import scrollBehavior from './router.scrollBehavior.js'
|
||||
|
||||
@ -109,7 +109,7 @@ export const routerOptions = {
|
||||
function decodeObj(obj) {
|
||||
for (const key in obj) {
|
||||
if (typeof obj[key] === 'string') {
|
||||
obj[key] = decodeURIComponent(obj[key])
|
||||
obj[key] = decode(obj[key])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@nuxt/devalue": "^1.2.4",
|
||||
"@nuxt/ufo": "^0.5.0",
|
||||
"@nuxt/utils": "2.14.11",
|
||||
"consola": "^2.15.0",
|
||||
"fs-extra": "^8.1.0",
|
||||
|
@ -43,7 +43,6 @@
|
||||
"thread-loader": "^2.1.3",
|
||||
"time-fix-plugin": "^2.0.7",
|
||||
"url-loader": "^2.3.0",
|
||||
"url-polyfill": "^1.1.12",
|
||||
"vue-loader": "^15.9.5",
|
||||
"webpack": "^4.44.2",
|
||||
"webpack-bundle-analyzer": "^3.9.0",
|
||||
|
@ -63,7 +63,7 @@ export default class WebpackClientConfig extends WebpackBaseConfig {
|
||||
cacheGroups.commons === undefined
|
||||
) {
|
||||
cacheGroups.commons = {
|
||||
test: /node_modules[\\/](vue|vue-loader|vue-router|vuex|vue-meta|core-js|@babel\/runtime|axios|webpack|setimmediate|timers-browserify|process|regenerator-runtime|cookie|js-cookie|is-buffer|dotprop|url-polyfill|nuxt\.js)[\\/]/,
|
||||
test: /node_modules[\\/](vue|vue-loader|vue-router|vuex|vue-meta|core-js|@babel\/runtime|axios|webpack|setimmediate|timers-browserify|process|regenerator-runtime|cookie|js-cookie|is-buffer|dotprop|url-polyfill|@nuxt[\\/]ufo|ufo|nuxt\.js)[\\/]/,
|
||||
chunks: 'all',
|
||||
name: true,
|
||||
priority: 10
|
||||
@ -205,11 +205,6 @@ export default class WebpackClientConfig extends WebpackBaseConfig {
|
||||
)
|
||||
}
|
||||
|
||||
// Add URL polyfill for IE11 support with ufo
|
||||
if (!this.isModern && !this.isServer) {
|
||||
config.entry.app.unshift(require.resolve('url-polyfill/url-polyfill.min.js'))
|
||||
}
|
||||
|
||||
// Add friendly error plugin
|
||||
if (this.dev && !quiet && friendlyErrors) {
|
||||
config.plugins.push(
|
||||
|
@ -23,7 +23,7 @@ describe('nuxt basic resources size limit', () => {
|
||||
const LEGACY_JS_RESOURCES_KB_SIZE = 217
|
||||
expect(legacyResourcesSize.uncompressed).toBeWithinSize(LEGACY_JS_RESOURCES_KB_SIZE)
|
||||
|
||||
const LEGACY_JS_RESOURCES_GZIP_KB_SIZE = 70
|
||||
const LEGACY_JS_RESOURCES_GZIP_KB_SIZE = 75
|
||||
expect(legacyResourcesSize.gzip).toBeWithinSize(LEGACY_JS_RESOURCES_GZIP_KB_SIZE)
|
||||
|
||||
const LEGACY_JS_RESOURCES_BROTLI_KB_SIZE = 64
|
||||
@ -36,7 +36,7 @@ describe('nuxt basic resources size limit', () => {
|
||||
const MODERN_JS_RESOURCES_KB_SIZE = 180
|
||||
expect(modernResourcesSize.uncompressed).toBeWithinSize(MODERN_JS_RESOURCES_KB_SIZE)
|
||||
|
||||
const MODERN_JS_RESOURCES_GZIP_KB_SIZE = 60
|
||||
const MODERN_JS_RESOURCES_GZIP_KB_SIZE = 64
|
||||
expect(modernResourcesSize.gzip).toBeWithinSize(MODERN_JS_RESOURCES_GZIP_KB_SIZE)
|
||||
|
||||
const MODERN_JS_RESOURCES_BROTLI_KB_SIZE = 55
|
||||
|
13
yarn.lock
13
yarn.lock
@ -1955,10 +1955,10 @@
|
||||
rc9 "^1.2.0"
|
||||
std-env "^2.2.1"
|
||||
|
||||
"@nuxt/ufo@^0.1.0":
|
||||
version "0.1.0"
|
||||
resolved "https://registry.npmjs.org/@nuxt/ufo/-/ufo-0.1.0.tgz#4943741c4300b73e4f1de09cad684ed4e9235502"
|
||||
integrity sha512-7az26cl4TaNejTFlgwcGRIGPFH6tD8dLh1t+Q+BWIM8UQqqV9o2DH9yKcVlboP+LdocLBUC+OTOiZc0RSZh0bA==
|
||||
"@nuxt/ufo@^0.5.0":
|
||||
version "0.5.0"
|
||||
resolved "https://registry.npmjs.org/@nuxt/ufo/-/ufo-0.5.0.tgz#a84d5ce9dedee25b81fbbb4b44fef5ca2987af39"
|
||||
integrity sha512-0My2z3nfJ8KTyz49/kyRBh0naoArsItDgfQP7qf38BfY8HAoiujFIANZyjpnq433UOU0wZqv0djHkydQX56FmQ==
|
||||
|
||||
"@nuxtjs/eslint-config@^5.0.0":
|
||||
version "5.0.0"
|
||||
@ -13205,11 +13205,6 @@ url-loader@^2.3.0:
|
||||
mime "^2.4.4"
|
||||
schema-utils "^2.5.0"
|
||||
|
||||
url-polyfill@^1.1.12:
|
||||
version "1.1.12"
|
||||
resolved "https://registry.npmjs.org/url-polyfill/-/url-polyfill-1.1.12.tgz#6cdaa17f6b022841b3aec0bf8dbd87ac0cd33331"
|
||||
integrity sha512-mYFmBHCapZjtcNHW0MDq9967t+z4Dmg5CJ0KqysK3+ZbyoNOWQHksGCTWwDhxGXllkWlOc10Xfko6v4a3ucM6A==
|
||||
|
||||
url@^0.11.0:
|
||||
version "0.11.0"
|
||||
resolved "https://registry.npmjs.org/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1"
|
||||
|
Loading…
Reference in New Issue
Block a user