Skip to content

Commit

Permalink
fix: compatiable esm
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 authored Jul 11, 2022
1 parent 066dc7c commit e185e53
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
"prettier": "^2.7.1",
"typescript": "^4.7.4",
"unbuild": "^0.7.4",
"vite": "^2.9.13",
"vitest": "^0.17.1"
"vite": "^2.9.14",
"vitest": "^0.18.0"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import path from 'path';
import createDebug from 'debug';
import { lightRed } from 'kolorist';
import { fileURLToPath } from 'url';
import { existsSync, writeFileSync } from 'fs';

import { version } from '../package.json';
Expand Down Expand Up @@ -42,7 +43,7 @@ async function main(args: string[]) {
if (_filename) {
const filename = _filename.endsWith('.ts') ? _filename : _filename + '.ts';
if (!existsSync(filename)) {
const globalsDts = path.join(__dirname, '../globals.d.ts');
const globalsDts = path.join(fileURLToPath(import.meta.url), '../../globals.d.ts');
const template = [
'#!/usr/bin/env optc',
'',
Expand Down

0 comments on commit e185e53

Please sign in to comment.