Skip to content

Commit cd14330

Browse files
committed
Use tsc output in build.mjs rather than compiling twice
1 parent 3db7caf commit cd14330

13 files changed

Lines changed: 58415 additions & 46826 deletions

‎build.mjs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const __filename = fileURLToPath(import.meta.url);
1111
const __dirname = dirname(__filename);
1212

1313
const SRC_DIR = join(__dirname, "src");
14+
const BUILD_DIR = join(__dirname, "build");
1415
const OUT_DIR = join(__dirname, "lib");
1516

1617
/**
@@ -95,7 +96,7 @@ const entryPointsPlugin = {
9596

9697
// Find the source files containing Action entry points.
9798
build.onStart(() => {
98-
const actionFiles = globSync("src/*-action{,-post}.ts");
99+
const actionFiles = globSync(join(BUILD_DIR, "*-action{,-post}.js"));
99100
for (const actionFile of actionFiles) {
100101
const match = basename(actionFile).match(/(.*)-action(-post)?/);
101102

@@ -137,7 +138,7 @@ const entryPointsPlugin = {
137138
const imports = actionsSorted
138139
.map(
139140
(action) =>
140-
`import * as ${action.pascalCaseName} from "./src/${basename(action.path)}";`,
141+
`import * as ${action.pascalCaseName} from "./build/${basename(action.path)}";`,
141142
)
142143
.join("\n");
143144
const wrappers = actionsSorted
@@ -153,7 +154,7 @@ const entryPointsPlugin = {
153154
return {
154155
contents: `"use strict";\n${imports}\n\n${uploadLibReExport}\n\n${wrappers}\n`,
155156
resolveDir: ".",
156-
loader: "ts",
157+
loader: "js",
157158
};
158159
});
159160

‎lib/analyze-entry.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/analyze-post-entry.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/autobuild-entry.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)