Skip to content

Commit

Permalink
feat: export source maps from vercel/ncc
Browse files Browse the repository at this point in the history
  • Loading branch information
bangarang committed Jul 4, 2024
1 parent 5270e34 commit b180cf4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/cli/src/x/actions/deploy.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@ export async function deployAction(
}).start()

try {
const { err, code } = await ncc(path.join(outDir, '_entry.js'), {
const { err, code, map } = await ncc(path.join(outDir, '_entry.js'), {
minify: liteMode,
target: 'es2020',
sourceMap: true,
cache: false,
// TODO: add debug flag to add this and other debug options
quiet: true,
Expand All @@ -231,6 +232,8 @@ export async function deployAction(

const deployFile = path.join(outDir, 'deploy.js')
fs.writeFileSync(deployFile, code, 'utf8')
const mapFile = path.join(outDir, 'deploy.js.map')
fs.writeFileSync(mapFile, map, 'utf8')
const activeTopics: Flatfile.EventTopic[] = await getActiveTopics(
deployFile
)
Expand All @@ -245,6 +248,9 @@ export async function deployAction(
topics: activeTopics,
compiler: 'js',
source: code,
// TODO: Add this to the Agent Table
// @ts-ignore
map,
slug: slug ?? selectedAgent?.slug,
},
})
Expand Down

0 comments on commit b180cf4

Please sign in to comment.