File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @marko/vite " : patch
3
+ ---
4
+
5
+ Fix issue where link mode was incorrectly left enabled in test environments.
Original file line number Diff line number Diff line change @@ -167,6 +167,12 @@ export default function markoPlugin(opts: Options = {}): vite.Plugin[] {
167
167
enforce : "pre" , // Must be pre to allow us to resolve assets before vite.
168
168
async config ( config , env ) {
169
169
let optimize = env . mode === "production" ;
170
+ isTest = env . mode === "test" ;
171
+ isBuild = env . command === "build" ;
172
+
173
+ if ( isTest ) {
174
+ linked = false ;
175
+ }
170
176
171
177
if ( "MARKO_DEBUG" in process . env ) {
172
178
optimize =
@@ -239,8 +245,6 @@ export default function markoPlugin(opts: Options = {}): vite.Plugin[] {
239
245
compiler . configure ( baseConfig ) ;
240
246
devEntryFile = path . join ( root , "index.html" ) ;
241
247
devEntryFilePosix = normalizePath ( devEntryFile ) ;
242
- isTest = env . mode === "test" ;
243
- isBuild = env . command === "build" ;
244
248
isSSRBuild = isBuild && linked && Boolean ( config . build ! . ssr ) ;
245
249
renderAssetsRuntimeCode = getRenderAssetsRuntime ( {
246
250
isBuild,
@@ -249,7 +253,6 @@ export default function markoPlugin(opts: Options = {}): vite.Plugin[] {
249
253
} ) ;
250
254
251
255
if ( isTest ) {
252
- linked = false ;
253
256
const { test } = config as any ;
254
257
255
258
if ( ( test . environment as string | undefined ) ?. includes ( "dom" ) ) {
You can’t perform that action at this time.
0 commit comments