fix: maybe
This commit is contained in:
7
node_modules/svelte-preprocess/dist/transformers/typescript.js
generated
vendored
7
node_modules/svelte-preprocess/dist/transformers/typescript.js
generated
vendored
@ -82,7 +82,6 @@ function createSourceMapChain({ filename, content, compilerOptions, }) {
|
||||
function injectVarsToCode({ content, markup, filename, attributes, sourceMapChain, }) {
|
||||
if (!markup)
|
||||
return content;
|
||||
// @ts-ignore different in Svelte 5
|
||||
const { vars } = (0, compiler_1.compile)((0, markup_1.stripTags)(markup), {
|
||||
generate: false,
|
||||
varsReport: 'full',
|
||||
@ -324,11 +323,9 @@ const transformer = async ({ content, filename, markup, options = {}, attributes
|
||||
filename = (0, path_1.isAbsolute)(filename) ? filename : (0, path_1.resolve)(basePath, filename);
|
||||
const compilerOptions = getCompilerOptions({ filename, options, basePath });
|
||||
const versionParts = package_json_1.default.version.split('.');
|
||||
const canUseMixedImportsTranspiler = +versionParts[0] === 4 ||
|
||||
(+versionParts[0] === 3 && +versionParts[1] >= 39);
|
||||
const canUseMixedImportsTranspiler = +versionParts[0] > 3 || (+versionParts[0] === 3 && +versionParts[1] >= 39);
|
||||
if (!canUseMixedImportsTranspiler && options.handleMixedImports) {
|
||||
throw new Error('You need at least Svelte 3.39 and at most Svelte 4.x to use the handleMixedImports option. ' +
|
||||
'The option is no longer available for Svelte 5 and beyond. Use the verbatimModuleSyntax TypeScript option instead.');
|
||||
throw new Error('You need at least Svelte 3.39 to use the handleMixedImports option');
|
||||
}
|
||||
const handleMixedImports = !compilerOptions.preserveValueImports &&
|
||||
!compilerOptions.verbatimModuleSyntax &&
|
||||
|
2
node_modules/svelte-preprocess/dist/types/index.d.ts
generated
vendored
2
node_modules/svelte-preprocess/dist/types/index.d.ts
generated
vendored
@ -9,7 +9,7 @@ export type TransformerArgs<T> = {
|
||||
attributes?: Record<string, any>;
|
||||
map?: string | object;
|
||||
markup?: string;
|
||||
diagnostics?: unknown[];
|
||||
dianostics?: unknown[];
|
||||
options?: T;
|
||||
};
|
||||
/**
|
||||
|
Reference in New Issue
Block a user