Skip to content

Commit

Permalink
Correctly generate import path for nested entries
Browse files Browse the repository at this point in the history
  • Loading branch information
mrm007 committed Feb 9, 2024
1 parent cf36116 commit 0b2f542
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/lazy-rockets-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@crackle/core': patch
---

Correctly generate import paths in stub entry points for deeply nested entries
2 changes: 1 addition & 1 deletion packages/core/src/utils/dev-entry-points.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const getHookLoader = async (
format: Format,
): Promise<HookLoader> => {
const stringifyRelative = (p: string) =>
JSON.stringify(path.relative(entry.outputDir, p));
JSON.stringify(path.relative(entry.packageDir, p));

const config = getConfigFromContext();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* #region dist/deep/re-export.cjs */
require("../../../node_modules/.pnpm/tsx@[version]/node_modules/tsx/dist/cjs/index.cjs");
require("../../../../node_modules/.pnpm/tsx@[version]/node_modules/tsx/dist/cjs/index.cjs");

const _mod = require("../src/entries/deep/re-export.ts");
const _mod = require("../../src/entries/deep/re-export.ts");

module.exports = _mod;
/* #endregion */
Expand All @@ -24,9 +24,9 @@ import { createRequire } from "module";

const require = createRequire(import.meta.url);

require("../../../node_modules/.pnpm/tsx@[version]/node_modules/tsx/dist/cjs/index.cjs");
require("../../../../node_modules/.pnpm/tsx@[version]/node_modules/tsx/dist/cjs/index.cjs");

const _mod = require("../src/entries/deep/re-export.ts");
const _mod = require("../../src/entries/deep/re-export.ts");

export const something = _mod.something;
export default _mod.default;
Expand Down

0 comments on commit 0b2f542

Please sign in to comment.