@poppinss/ts-exec 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/loader.js +17 -7
- package/build/src/transform.d.ts +1 -1
- package/package.json +1 -1
package/build/src/loader.js
CHANGED
|
@@ -58,13 +58,23 @@ function tsConfigToSwcConfig(tsConfig2) {
|
|
|
58
58
|
dynamicImport: true
|
|
59
59
|
},
|
|
60
60
|
transform: {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
...tsConfig2.compilerOptions?.emitDecoratorMetadata ? {
|
|
62
|
+
decoratorMetadata: true
|
|
63
|
+
} : {},
|
|
64
|
+
...tsConfig2.compilerOptions?.experimentalDecorators ? {
|
|
65
|
+
legacyDecorator: true
|
|
66
|
+
} : {},
|
|
67
|
+
...tsConfig2.compilerOptions?.verbatimModuleSyntax ? {
|
|
68
|
+
verbatimModuleSyntax: true
|
|
69
|
+
} : {},
|
|
70
|
+
...tsConfig2.compilerOptions?.useDefineForClassFields ? {
|
|
71
|
+
useDefineForClassFields: true
|
|
72
|
+
} : {},
|
|
65
73
|
react: {
|
|
66
74
|
runtime: "automatic",
|
|
67
|
-
|
|
75
|
+
...tsConfig2.compilerOptions?.jsxImportSource ? {
|
|
76
|
+
importSource: tsConfig2.compilerOptions?.jsxImportSource
|
|
77
|
+
} : {}
|
|
68
78
|
}
|
|
69
79
|
},
|
|
70
80
|
keepClassNames: true
|
|
@@ -92,7 +102,7 @@ function getConfig(searchPath) {
|
|
|
92
102
|
}
|
|
93
103
|
|
|
94
104
|
// src/transform.ts
|
|
95
|
-
import {
|
|
105
|
+
import { transform as swcTransform } from "@swc/core";
|
|
96
106
|
function transformSync(source, options) {
|
|
97
107
|
const input = `${source ?? ""}`;
|
|
98
108
|
const { format, ...rest } = options;
|
|
@@ -193,7 +203,7 @@ var load = async function load2(url, context, nextLoad) {
|
|
|
193
203
|
...context,
|
|
194
204
|
format: "module"
|
|
195
205
|
});
|
|
196
|
-
const { code, map } = transformSync(source.toString(), {
|
|
206
|
+
const { code, map } = await transformSync(source.toString(), {
|
|
197
207
|
format: format ?? "module-tsx",
|
|
198
208
|
filename: fileURLToPath3(url),
|
|
199
209
|
...swcConfig
|
package/build/src/transform.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ import { Config as SwcConfig } from '@swc/core';
|
|
|
5
5
|
export declare function transformSync(source: string, options: SwcConfig & {
|
|
6
6
|
filename: string;
|
|
7
7
|
format: 'module-typescript' | 'commonjs-typescript' | 'module-tsx';
|
|
8
|
-
}): import("@swc/types").Output
|
|
8
|
+
}): Promise<import("@swc/types").Output>;
|