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: fix issues with route normalization #8462

Merged
merged 5 commits into from Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 0 additions & 1 deletion packages/vue-app/package.json
Expand Up @@ -16,7 +16,6 @@
"@nuxt/ufo": "^0.1.0",
"node-fetch": "^2.6.1",
"unfetch": "^4.2.0",
"url-polyfill": "^1.1.12",
"vue": "^2.6.12",
"vue-client-only": "^2.0.0",
"vue-meta": "^2.4.0",
Expand Down
1 change: 0 additions & 1 deletion packages/vue-app/template/utils.js
@@ -1,5 +1,4 @@
import Vue from 'vue'
import 'url-polyfill'
import { normalizeURL } from '@nuxt/ufo'

// window.{{globals.loadedCallback}} hook
Expand Down
1 change: 1 addition & 0 deletions packages/webpack/package.json
Expand Up @@ -43,6 +43,7 @@
"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",
Expand Down
5 changes: 5 additions & 0 deletions packages/webpack/src/config/client.js
Expand Up @@ -205,6 +205,11 @@ 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(
Expand Down
6 changes: 3 additions & 3 deletions test/dev/async-config.size-limit.test.js
Expand Up @@ -20,20 +20,20 @@ describe('nuxt basic resources size limit', () => {
it('should stay within the size limit range in legacy mode', async () => {
const legacyResourcesSize = await getResourcesSize(distDir, 'client', { gzip: true, brotli: true })

const LEGACY_JS_RESOURCES_KB_SIZE = 201
const LEGACY_JS_RESOURCES_KB_SIZE = 217
expect(legacyResourcesSize.uncompressed).toBeWithinSize(LEGACY_JS_RESOURCES_KB_SIZE)

const LEGACY_JS_RESOURCES_GZIP_KB_SIZE = 70
expect(legacyResourcesSize.gzip).toBeWithinSize(LEGACY_JS_RESOURCES_GZIP_KB_SIZE)

const LEGACY_JS_RESOURCES_BROTLI_KB_SIZE = 60
const LEGACY_JS_RESOURCES_BROTLI_KB_SIZE = 64
expect(legacyResourcesSize.brotli).toBeWithinSize(LEGACY_JS_RESOURCES_BROTLI_KB_SIZE)
})

it('should stay within the size limit range in modern mode', async () => {
const modernResourcesSize = await getResourcesSize(distDir, 'modern', { gzip: true, brotli: true })

const MODERN_JS_RESOURCES_KB_SIZE = 172
const MODERN_JS_RESOURCES_KB_SIZE = 180
pi0 marked this conversation as resolved.
Show resolved Hide resolved
expect(modernResourcesSize.uncompressed).toBeWithinSize(MODERN_JS_RESOURCES_KB_SIZE)

const MODERN_JS_RESOURCES_GZIP_KB_SIZE = 60
Expand Down