diff --git a/package.json b/package.json index 2a6e958b..9ee76979 100644 --- a/package.json +++ b/package.json @@ -4,17 +4,16 @@ "license": "MIT", "description": "Command line tool generates markdown as html.", "homepage": "https://jaywcjlove.github.io/markdown-to-html-cli/", - "type": "module", + "main": "./lib/index.js", "types": "./lib/index.d.ts", - "exports": "./lib/index.js", "bin": { "markdown-to-html": "lib/cli.js", "markdown-to-html-cli": "lib/cli.js" }, "scripts": { "start": "node lib/cli.js --github-corners-fork --github-corners 'https://jaywcjlove.github.io'", - "watch": "tsbb watch --disable-babel -f src/cli.ts", - "build": "tsbb build --disable-babel -f src/cli.ts && npm run fix", + "watch": "tsbb watch --no-esm -f src/cli.ts", + "build": "tsbb build --no-esm -f src/cli.ts && npm run fix", "fix": "tsc-esm-fix --target='lib' --ext='.js'", "test": "npm run build && tsbb test", "coverage": "npm run build && tsbb test --coverage" @@ -73,6 +72,6 @@ "unified": "10.1.1" }, "devDependencies": { - "tsbb": "3.5.1" + "tsbb": "3.5.2" } } diff --git a/src/create.ts b/src/create.ts index 068784b0..b28d0bee 100644 --- a/src/create.ts +++ b/src/create.ts @@ -27,7 +27,8 @@ import { octiconLink } from './nodes/octiconLink'; import { MDToHTMLOptions } from './'; // https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-when-using-the-experimental-modules-flag -export const _dirname = dirname(fileURLToPath(import.meta.url)); +// export const _dirname = dirname(fileURLToPath(import.meta.url)); +export const _dirname = __dirname; export interface CreateOptions extends MDToHTMLOptions { } export function create(options = {} as MDToHTMLOptions) { diff --git a/tsconfig.json b/tsconfig.json index 21ba529c..ed3db6dc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { - "module": "ES2020", + "module": "ESNext", + "allowJs": true, // "module": "es2015", "target": "ESNext", "esModuleInterop": true,