Skip to content

Commit

Permalink
chore: optimize compiler config for type striping call
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Dec 13, 2023
1 parent 7541855 commit 08f365d
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions packages/language-tools/src/processors/marko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@ export default {
runtimeTypes.internalTypesFile,
runtimeTypes.markoTypesFile,
];
const compileConfig: import("@marko/compiler").Config = {
output: "source",
stripTypes: true,
sourceMaps: true,
babelConfig: {
babelrc: false,
configFile: false,
browserslistConfigFile: false,
caller: {
name: "@marko/type-check",
supportsStaticESM: true,
supportsDynamicImport: true,
supportsTopLevelAwait: true,
supportsExportNamespaceFrom: true,
},
},
};

if (runtimeTypes.markoRunTypesFile) {
rootNames.push(runtimeTypes.markoRunTypesFile);
Expand Down Expand Up @@ -65,11 +82,7 @@ export default {
print({ extracted: { parsed } }) {
const { code, map } = Project.getCompiler(
path.dirname(parsed.filename),
).compileSync(parsed.code, parsed.filename, {
output: "source",
stripTypes: true,
sourceMaps: true,
});
).compileSync(parsed.code, parsed.filename, compileConfig);
return { code, map };
},
printTypes({ printer, typeChecker, sourceFile, formatSettings }) {
Expand Down

0 comments on commit 08f365d

Please sign in to comment.