Skip to content

Commit

Permalink
fix: Fix test errors. #28
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Dec 1, 2021
1 parent 8898683 commit fcabee5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 4 additions & 5 deletions package.json
Expand Up @@ -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"
Expand Down Expand Up @@ -73,6 +72,6 @@
"unified": "10.1.1"
},
"devDependencies": {
"tsbb": "3.5.1"
"tsbb": "3.5.2"
}
}
3 changes: 2 additions & 1 deletion src/create.ts
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"module": "ES2020",
"module": "ESNext",
"allowJs": true,
// "module": "es2015",
"target": "ESNext",
"esModuleInterop": true,
Expand Down

0 comments on commit fcabee5

Please sign in to comment.