Skip to content

Commit

Permalink
feat: ✨ added support for source maps
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 9, 2020
1 parent e81e3e2 commit 3435f7e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"@types/node": "14.14.10",
"@types/prettier": "2.1.5",
"@types/rimraf": "3.0.0",
"@types/source-map-support": "^0.5.3",
"@typescript-eslint/eslint-plugin": "4.9.0",
"@typescript-eslint/parser": "4.9.0",
"devmoji": "2.1.12",
Expand All @@ -97,6 +98,7 @@
"prettier": "2.2.1",
"release-it": "14.2.2",
"rimraf": "3.0.2",
"source-map-support": "^0.5.19",
"type-fest": "0.20.2",
"typescript": "4.1.2",
"typesync": "0.8.0"
Expand Down
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions src/esbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function _transform(code: string, filename: string): string {
logLevel: "error",
target: [`node${process.version.slice(1)}`],
minify: false,
sourcemap: true,
sourcemap: "inline",
sourcefile: filename,
})
return ret.code
Expand All @@ -66,7 +66,7 @@ function _bundle(code: string, filename: string): string {
format: "cjs",
target: [`node${process.version.slice(1)}`],
minify: false,
sourcemap: true,
sourcemap: "inline",
write: false,
})
.outputFiles.map((f) => f.text)
Expand Down
3 changes: 3 additions & 0 deletions src/register.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
import { install as installSourceMapSupport } from "source-map-support"
import { install } from "./hook"

installSourceMapSupport({ hookRequire: true })
install()

0 comments on commit 3435f7e

Please sign in to comment.