File tree 4 files changed +15
-1
lines changed
4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -83,4 +83,8 @@ if (isBuild) {
83
83
test ( 'should emit css file' , async ( ) => {
84
84
expect ( listAssets ( ) . some ( ( filename ) => filename . endsWith ( '.css' ) ) )
85
85
} )
86
+
87
+ test ( 'includes structuredClone polyfill which is supported after core-js v3' , ( ) => {
88
+ expect ( findAssetFile ( / p o l y f i l l s - l e g a c y / ) ) . toMatch ( '"structuredClone"' )
89
+ } )
86
90
}
Original file line number Diff line number Diff line change 1
1
< h1 id ="app "> </ h1 >
2
2
< div id ="env "> </ div >
3
3
< div id ="iterators "> </ div >
4
+ < div id ="features-after-corejs-3 "> </ div >
4
5
< div id ="babel-helpers "> </ div >
5
6
< div id ="assets "> </ div >
6
7
< script type ="module " src ="./main.js "> </ script >
Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ text('#env', `is legacy: ${isLegacy}`)
21
21
// Iterators
22
22
text ( '#iterators' , [ ...new Set ( [ 'hello' ] ) ] . join ( '' ) )
23
23
24
+ // structuredClone is supported core.js v3.20.0+
25
+ text (
26
+ '#features-after-corejs-3' ,
27
+ JSON . stringify ( structuredClone ( { foo : 'foo' } ) )
28
+ )
29
+
24
30
// babel-helpers
25
31
// Using `String.raw` to inject `@babel/plugin-transform-template-literals`
26
32
// helpers.
Original file line number Diff line number Diff line change @@ -330,7 +330,10 @@ function viteLegacyPlugin(options = {}) {
330
330
loose : false ,
331
331
useBuiltIns : needPolyfills ? 'usage' : false ,
332
332
corejs : needPolyfills
333
- ? { version : 3 , proposals : false }
333
+ ? {
334
+ version : require ( 'core-js/package.json' ) . version ,
335
+ proposals : false
336
+ }
334
337
: undefined ,
335
338
shippedProposals : true ,
336
339
ignoreBrowserslistConfig : options . ignoreBrowserslistConfig
You can’t perform that action at this time.
0 commit comments