File tree 3 files changed +18
-18
lines changed
3 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ export const ASTRO_CONFIG_DEFAULTS = {
102
102
serializeConfig : false ,
103
103
session : false ,
104
104
headingIdCompat : false ,
105
- preserveScriptOrder : false
105
+ preserveScriptOrder : false ,
106
106
} ,
107
107
} satisfies AstroUserConfig & { server : { open : boolean } } ;
108
108
@@ -622,7 +622,10 @@ export const AstroConfigSchema = z.object({
622
622
. boolean ( )
623
623
. optional ( )
624
624
. default ( ASTRO_CONFIG_DEFAULTS . experimental . headingIdCompat ) ,
625
- preserveScriptOrder : z . boolean ( ) . optional ( ) . default ( ASTRO_CONFIG_DEFAULTS . experimental . preserveScriptOrder ) ,
625
+ preserveScriptOrder : z
626
+ . boolean ( )
627
+ . optional ( )
628
+ . default ( ASTRO_CONFIG_DEFAULTS . experimental . preserveScriptOrder ) ,
626
629
} )
627
630
. strict (
628
631
`Invalid or outdated experimental feature.\nCheck for incorrect spelling or outdated Astro version.\nSee https://docs.astro.build/en/reference/experimental-flags/ for a list of all current experiments.` ,
Original file line number Diff line number Diff line change @@ -2176,13 +2176,13 @@ export interface ViteUserConfig extends OriginalViteUserConfig {
2176
2176
* @default `false`
2177
2177
* @version 5.5
2178
2178
* @description
2179
- *
2179
+ *
2180
2180
* When enabled, `<script>` and `<style>` tags are rendered in the same order as they are defined.
2181
- *
2181
+ *
2182
2182
* ## Example
2183
- *
2183
+ *
2184
2184
* Consider the following component:
2185
- *
2185
+ *
2186
2186
* ```html
2187
2187
* <p>I am a component</p>
2188
2188
* <style>
@@ -2196,19 +2196,19 @@ export interface ViteUserConfig extends OriginalViteUserConfig {
2196
2196
* }
2197
2197
* </style>
2198
2198
* ```
2199
- *
2199
+ *
2200
2200
* By default, it will generate a CSS style where `red` will be applied:
2201
- *
2201
+ *
2202
2202
* ```css
2203
2203
* body {background:#ff0} body {background:red}
2204
2204
* ```
2205
- *
2205
+ *
2206
2206
* When this new option is set to `true`, the generated CSS style will apply `yellow`:
2207
- *
2207
+ *
2208
2208
* ```css
2209
2209
* body {background:red} body {background:#ff0}
2210
2210
* ```
2211
- *
2211
+ *
2212
2212
*/
2213
2213
preserveScriptOrder : boolean ;
2214
2214
} ;
Original file line number Diff line number Diff line change @@ -111,26 +111,23 @@ describe('CSS production ordering', () => {
111
111
}
112
112
} ) ;
113
113
} ) ;
114
-
115
-
116
- describe ( "Changes order when transparentScriptOrder is enabled" , ( ) => {
114
+
115
+ describe ( 'Changes order when transparentScriptOrder is enabled' , ( ) => {
117
116
/** @type {import('./test-utils').Fixture } */
118
117
let fixture ;
119
-
118
+
120
119
before ( async ( ) => {
121
120
fixture = await loadFixture ( {
122
121
root : './fixtures/css-order-transparent/' ,
123
122
} ) ;
124
123
await fixture . build ( ) ;
125
124
} ) ;
126
125
127
-
128
126
it ( 'should compile styles in the same order as they are found' , async ( ) => {
129
127
const html = await fixture . readFile ( '/index.html' ) ;
130
128
131
129
// The component declares red background first, then yellow
132
130
assert . match ( html , / b o d y \{ b a c k g r o u n d : r e d \} b o d y \{ b a c k g r o u n d : # f f 0 / ) ;
133
131
} ) ;
134
-
135
- } )
132
+ } ) ;
136
133
} ) ;
You can’t perform that action at this time.
0 commit comments