@@ -37,6 +37,7 @@ const regex_valid_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
37
37
const regex_starts_with_lowercase_character = / ^ [ a - z ] / ;
38
38
39
39
let warned_of_format = false ;
40
+ let warned_boolean_css = false ;
40
41
41
42
/**
42
43
* @param {import('../interfaces.js').CompileOptions } options
@@ -86,23 +87,23 @@ function validate_options(options, warnings) {
86
87
toString : ( ) => message
87
88
} ) ;
88
89
}
89
- if ( valid_css_values . indexOf ( css ) === - 1 ) {
90
- throw new Error (
91
- `options.css must be true, false, 'injected', 'external', or 'none' (got '${ css } ')`
92
- ) ;
93
- }
90
+
94
91
if ( css === true || css === false ) {
95
92
options . css = css === true ? 'injected' : 'external' ;
96
- // possibly show this warning once we decided how Svelte 4 looks like
97
- // const message = `options.css as a boolean is deprecated. Use '${options.css}' instead of ${css}.`;
98
- // warnings.push({
99
- // code: 'options-css-boolean-deprecated',
100
- // message,
101
- // filename,
102
- // toString: () => message
103
- // });
104
- // }
93
+ if ( ! warned_boolean_css ) {
94
+ console . warn (
95
+ `compilerOptions.css as a boolean is deprecated. Use '${ options . css } ' instead of ${ css } .`
96
+ ) ;
97
+ warned_boolean_css = true ;
98
+ }
99
+ }
100
+
101
+ if ( ! valid_css_values . includes ( options . css ) ) {
102
+ throw new Error (
103
+ `compilerOptions.css must be 'injected', 'external' or 'none' (got '${ options . css } ').`
104
+ ) ;
105
105
}
106
+
106
107
if ( namespace && valid_namespaces . indexOf ( namespace ) === - 1 ) {
107
108
const match = fuzzymatch ( namespace , valid_namespaces ) ;
108
109
if ( match ) {
0 commit comments