|
|
|
|
@ -46,8 +46,6 @@ const valid_css_values = [
|
|
|
|
|
const regex_valid_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
|
|
|
|
|
const regex_starts_with_lowercase_character = /^[a-z]/;
|
|
|
|
|
|
|
|
|
|
let has_shown_deprecation = false;
|
|
|
|
|
|
|
|
|
|
function validate_options(options: CompileOptions, warnings: Warning[]) {
|
|
|
|
|
const { name, filename, loopGuardTimeout, dev, namespace, css } = options;
|
|
|
|
|
|
|
|
|
|
@ -91,16 +89,15 @@ function validate_options(options: CompileOptions, warnings: Warning[]) {
|
|
|
|
|
|
|
|
|
|
if (css === true || css === false) {
|
|
|
|
|
options.css = css === true ? 'injected' : 'external';
|
|
|
|
|
if (!has_shown_deprecation) {
|
|
|
|
|
has_shown_deprecation=true;
|
|
|
|
|
const message = `options.css as a boolean is deprecated. Use '${options.css}' instead of ${css}.`;
|
|
|
|
|
warnings.push({
|
|
|
|
|
code: 'options-css-boolean-deprecated',
|
|
|
|
|
message,
|
|
|
|
|
filename,
|
|
|
|
|
toString: () => message
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// possibly show this warning once we decided how Svelte 4 looks like
|
|
|
|
|
// const message = `options.css as a boolean is deprecated. Use '${options.css}' instead of ${css}.`;
|
|
|
|
|
// warnings.push({
|
|
|
|
|
// code: 'options-css-boolean-deprecated',
|
|
|
|
|
// message,
|
|
|
|
|
// filename,
|
|
|
|
|
// toString: () => message
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (namespace && valid_namespaces.indexOf(namespace) === -1) {
|
|
|
|
|
|