Skip to content
This repository was archived by the owner on Jun 22, 2020. It is now read-only.

Commit fc5ed25

Browse files
committed
Get self reference modules working
I was partially confused due to a potential spec bug in package.exports that didn't take into account top-level application (without a . main) This now works and has a passing test. Refs: nodejs/node#30633
1 parent f1f1095 commit fc5ed25

File tree

8 files changed

+3627
-18
lines changed

8 files changed

+3627
-18
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.nyc_output/

lib/constants.mjs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { dirname, resolve } from 'path';
2+
import { fileURLToPath } from 'url';
3+
4+
const __filename = fileURLToPath(import.meta.url);
5+
const __dirname = dirname(__filename);
6+
7+
/** @type {string} */
8+
export const projectRoot = resolve(__dirname, '../');

0 commit comments

Comments
 (0)