Skip to content

Commit 6c91e1a

Browse files
committed
chore: update lockfile
1 parent 37bdc0e commit 6c91e1a

File tree

4 files changed

+3301
-3618
lines changed

4 files changed

+3301
-3618
lines changed

packages/@vue/cli-service/__tests__/cors.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ test('build', async () => {
3030
// expect(index).toMatch(/<link [^>]+app[^>]+\.css rel=preload as=style crossorigin>/)
3131

3232
// should apply crossorigin and add integrity to scripts and css
33-
expect(index).toMatch(/<script defer="defer" src="\/js\/chunk-vendors\.\w{8}\.js" crossorigin integrity="sha384-.{64}\s?" type="module">/)
34-
expect(index).toMatch(/<script defer="defer" src="\/js\/app\.\w{8}\.js" crossorigin integrity="sha384-.{64}\s?" type="module">/)
33+
expect(index).toMatch(/<script defer="defer" type="module" src="\/js\/chunk-vendors\.\w{8}\.js" crossorigin integrity="sha384-.{64}\s?">/)
34+
expect(index).toMatch(/<script defer="defer" type="module" src="\/js\/app\.\w{8}\.js" crossorigin integrity="sha384-.{64}\s?">/)
3535
expect(index).toMatch(/<link href="\/css\/app\.\w{8}\.css" rel="stylesheet" crossorigin integrity="sha384-.{64}\s?">/)
3636

3737
// verify integrity is correct by actually running it

packages/@vue/cli-service/__tests__/modernMode.spec.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ test('modern mode', async () => {
3232
const index = await project.read('dist/index.html')
3333

3434
// should use <script type="module" crossorigin="use-credentials"> for modern bundle
35-
expect(index).toMatch(/<script defer="defer" src="\/js\/chunk-vendors\.\w{8}\.js" type="module">/)
36-
expect(index).toMatch(/<script defer="defer" src="\/js\/app\.\w{8}\.js" type="module">/)
35+
expect(index).toMatch(/<script defer="defer" type="module" src="\/js\/chunk-vendors\.\w{8}\.js">/)
36+
expect(index).toMatch(/<script defer="defer" type="module" src="\/js\/app\.\w{8}\.js">/)
3737

3838
// should use <link rel="modulepreload" crossorigin="use-credentials"> for modern bundle
3939
// expect(index).toMatch(/<link [^>]*js\/chunk-vendors\.\w{8}\.js" rel="modulepreload" as="script">/)
@@ -49,8 +49,8 @@ test('modern mode', async () => {
4949
expect(stdout2).toMatch('Build complete.')
5050
const index2 = await project.read('dist/index.html')
5151
// should use <script type="module" crossorigin="use-credentials"> for modern bundle
52-
expect(index2).toMatch(/<script defer="defer" src="\/js\/chunk-vendors\.\w{8}\.js" crossorigin="use-credentials" type="module">/)
53-
expect(index2).toMatch(/<script defer="defer" src="\/js\/app\.\w{8}\.js" crossorigin="use-credentials" type="module">/)
52+
expect(index2).toMatch(/<script defer="defer" type="module" src="\/js\/chunk-vendors\.\w{8}\.js" crossorigin="use-credentials">/)
53+
expect(index2).toMatch(/<script defer="defer" type="module" src="\/js\/app\.\w{8}\.js" crossorigin="use-credentials">/)
5454
// should use <link rel="modulepreload" crossorigin="use-credentials"> for modern bundle
5555
// expect(index2).toMatch(/<link [^>]*js\/chunk-vendors\.\w{8}\.js" rel="modulepreload" as="script" crossorigin="use-credentials">/)
5656
// expect(index2).toMatch(/<link [^>]*js\/app\.\w{8}\.js" rel="modulepreload" as="script" crossorigin="use-credentials">/)
@@ -133,7 +133,11 @@ test('should use correct hash for fallback bundles', async () => {
133133
const index = await project.read('dist/index.html')
134134
const jsFiles = (await fs.readdir(path.join(project.dir, 'dist/js'))).filter(f => f.endsWith('.js'))
135135
for (const f of jsFiles) {
136-
expect(index).toMatch(`<script defer="defer" src="/js/${f}"`)
136+
if (f.includes('legacy')) {
137+
expect(index).toMatch(`<script defer="defer" src="/js/${f}"`)
138+
} else {
139+
expect(index).toMatch(`<script defer="defer" type="module" src="/js/${f}"`)
140+
}
137141
}
138142
})
139143

packages/@vue/cli-service/__tests__/multiPage.spec.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ test('build w/ multi page', async () => {
110110
const assertSharedAssets = file => {
111111
// should split and preload vendor chunk
112112
// expect(file).toMatch(/<link [^>]*js\/chunk-vendors[^>]*\.js" rel="preload" as="script">/)
113-
expect(file).toMatch(/<script [^>]*src="\/js\/chunk-vendors\.\w+\.js" type="module">/)
113+
expect(file).toMatch(/<script [^>]*type="module" src="\/js\/chunk-vendors\.\w+\.js">/)
114114
}
115115

116116
const index = await project.read('dist/index.html')
117117
assertSharedAssets(index)
118118
// should split and preload common js and css
119119
// expect(index).toMatch(/<link [^>]*js\/chunk-common[^>]*\.js" rel="preload" as="script">/)
120-
expect(index).toMatch(/<script [^>]*src="\/js\/chunk-common\.\w+\.js" type="module">/)
120+
expect(index).toMatch(/<script [^>]*type="module" src="\/js\/chunk-common\.\w+\.js">/)
121121
expect(index).toMatch(/<link href="\/css\/chunk-common\.\w+\.css" rel="stylesheet">/)
122122
// expect(index).toMatch(/<link [^>]*chunk-common[^>]*\.css" rel="preload" as="style">/)
123123
// should preload correct page file
@@ -128,9 +128,9 @@ test('build w/ multi page', async () => {
128128
// expect(index).toMatch(/<link [^>]*css\/chunk-\w+\.\w+\.css" rel="prefetch">/)
129129
// expect(index).toMatch(/<link [^>]*js\/chunk-\w+\.\w+\.js" rel="prefetch">/)
130130
// should load correct page js
131-
expect(index).toMatch(/<script [^>]*src="\/js\/index\.\w+\.js" type="module">/)
132-
expect(index).not.toMatch(/<script [^>]*src="\/js\/foo\.\w+\.js" type="module">/)
133-
expect(index).not.toMatch(/<script [^>]*src="\/js\/bar\.\w+\.js" type="module">/)
131+
expect(index).toMatch(/<script [^>]*type="module" src="\/js\/index\.\w+\.js">/)
132+
expect(index).not.toMatch(/<script [^>]*type="module" src="\/js\/foo\.\w+\.js">/)
133+
expect(index).not.toMatch(/<script [^>]*type="module" src="\/js\/bar\.\w+\.js">/)
134134

135135
const foo = await project.read('dist/foo.html')
136136
assertSharedAssets(foo)
@@ -143,9 +143,9 @@ test('build w/ multi page', async () => {
143143
// expect(foo).not.toMatch(/<link [^>]*css\/chunk-\w+\.\w+\.css" rel="prefetch">/)
144144
// expect(foo).not.toMatch(/<link [^>]*js\/chunk-\w+\.\w+\.js" rel="prefetch">/)
145145
// should load correct page js
146-
expect(foo).not.toMatch(/<script [^>]*src="\/js\/index\.\w+\.js" type="module">/)
147-
expect(foo).toMatch(/<script [^>]*src="\/js\/foo\.\w+\.js" type="module">/)
148-
expect(foo).not.toMatch(/<script [^>]*src="\/js\/bar\.\w+\.js" type="module">/)
146+
expect(foo).not.toMatch(/<script [^>]*type="module" src="\/js\/index\.\w+\.js">/)
147+
expect(foo).toMatch(/<script [^>]*type="module" src="\/js\/foo\.\w+\.js">/)
148+
expect(foo).not.toMatch(/<script [^>]*type="module" src="\/js\/bar\.\w+\.js">/)
149149

150150
const bar = await project.read('dist/bar.html')
151151
assertSharedAssets(bar)
@@ -162,9 +162,9 @@ test('build w/ multi page', async () => {
162162
// expect(bar).toMatch(/<link [^>]*css\/chunk-\w+\.\w+\.css" rel="prefetch">/)
163163
// expect(bar).toMatch(/<link [^>]*js\/chunk-\w+\.\w+\.js" rel="prefetch">/)
164164
// should load correct page js
165-
expect(bar).not.toMatch(/<script [^>]*src="\/js\/index\.\w+\.js" type="module">/)
166-
expect(bar).not.toMatch(/<script [^>]*src="\/js\/foo\.\w+\.js" type="module">/)
167-
expect(bar).toMatch(/<script [^>]*src="\/js\/bar\.\w+\.js" type="module">/)
165+
expect(bar).not.toMatch(/<script [^>]*type="module" src="\/js\/index\.\w+\.js" >/)
166+
expect(bar).not.toMatch(/<script [^>]*type="module" src="\/js\/foo\.\w+\.js" >/)
167+
expect(bar).toMatch(/<script [^>]*type="module" src="\/js\/bar\.\w+\.js">/)
168168

169169
// assert pages work
170170
const port = await portfinder.getPortPromise()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy