Skip to content

Commit 7597bb0

Browse files
committed
test: fix ssr tests
1 parent 9d2f9a0 commit 7597bb0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Diff for: test/ssr/compile-with-webpack.js

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import MemoryFS from 'memory-fs'
44

55
export function compileWithWebpack (file, extraConfig, cb) {
66
const config = Object.assign({
7+
mode: 'development',
78
entry: path.resolve(__dirname, 'fixtures', file),
89
module: {
910
rules: [

Diff for: test/ssr/ssr-template.spec.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import webpack from 'webpack'
21
import Vue from '../../dist/vue.runtime.common.js'
32
import { compileWithWebpack } from './compile-with-webpack'
43
import { createRenderer } from '../../packages/vue-server-renderer'
@@ -14,11 +13,12 @@ function generateClientManifest (file, cb) {
1413
path: '/',
1514
filename: '[name].js'
1615
},
16+
optimization: {
17+
runtimeChunk: {
18+
name: 'manifest'
19+
}
20+
},
1721
plugins: [
18-
new webpack.optimize.CommonsChunkPlugin({
19-
name: 'manifest',
20-
minChunks: Infinity
21-
}),
2222
new VueSSRClientPlugin()
2323
]
2424
}, fs => {
@@ -227,8 +227,8 @@ describe('SSR: template option', () => {
227227
`<link rel="preload" href="/0.js" as="script">` +
228228
`<link rel="preload" href="/test.css" as="style">` +
229229
// images and fonts are only preloaded when explicitly asked for
230-
(options.preloadOtherAssets ? `<link rel="preload" href="/test.woff2" as="font" type="font/woff2" crossorigin>` : ``) +
231230
(options.preloadOtherAssets ? `<link rel="preload" href="/test.png" as="image">` : ``) +
231+
(options.preloadOtherAssets ? `<link rel="preload" href="/test.woff2" as="font" type="font/woff2" crossorigin>` : ``) +
232232
// unused chunks should have prefetch
233233
(options.noPrefetch ? `` : `<link rel="prefetch" href="/1.js">`) +
234234
// css assets should be loaded

0 commit comments

Comments
 (0)