diff --git a/.changeset/angry-stingrays-fetch.md b/.changeset/angry-stingrays-fetch.md new file mode 100644 index 0000000000..191c7f29df --- /dev/null +++ b/.changeset/angry-stingrays-fetch.md @@ -0,0 +1,5 @@ +--- +"@medusajs/framework": patch +--- + +fix(framework): Fix compiler to create the dist after clean-up diff --git a/packages/core/framework/src/build-tools/compiler.ts b/packages/core/framework/src/build-tools/compiler.ts index c697c0fa42..e935bb5e5f 100644 --- a/packages/core/framework/src/build-tools/compiler.ts +++ b/packages/core/framework/src/build-tools/compiler.ts @@ -1,7 +1,7 @@ import type { AdminOptions, ConfigModule, Logger } from "@medusajs/types" import { FileSystem, getConfigFile, getResolvedPlugins } from "@medusajs/utils" import chokidar from "chokidar" -import { access, constants, copyFile, rm } from "fs/promises" +import { access, constants, copyFile, mkdir, rm } from "fs/promises" import path from "path" import type tsStatic from "typescript" @@ -284,6 +284,11 @@ export class Compiler { ) await this.#clean(dist) + /** + * Create first the target directory now that everything is clean + */ + await mkdir(dist, { recursive: true }) + /** * Step 2: Compile TypeScript source code */