Skip to content

Commit

Permalink
fix: pass sourcemap inline option to esbuild (egoist#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
fox1t committed Dec 14, 2021
1 parent d428ce7 commit 10e2720
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/esbuild/index.ts
Expand Up @@ -131,7 +131,11 @@ export async function runEsbuild(
globalName: options.globalName,
jsxFactory: options.jsxFactory,
jsxFragment: options.jsxFragment,
sourcemap: options.sourcemap ? 'external' : false,
sourcemap: options.sourcemap
? options.sourcemap === 'inline'
? options.sourcemap
: 'external'
: false,
target: options.target,
footer: options.footer,
banner: options.banner,
Expand Down
2 changes: 1 addition & 1 deletion src/options.ts
Expand Up @@ -58,7 +58,7 @@ export type Options = {
[k: string]: string
}
dts?: boolean | string | DtsConfig
sourcemap?: boolean
sourcemap?: boolean | 'inline'
/** Always bundle modules matching given patterns */
noExternal?: (string | RegExp)[]
/** Don't bundle these modules */
Expand Down
2 changes: 1 addition & 1 deletion test/index.test.ts
Expand Up @@ -185,7 +185,7 @@ test('bundle graphql-tools with --sourcemap inline flag', async (t) => {
}
)

t.assert(output.includes('//# sourceMappingURL='))
t.assert(output.includes('//# sourceMappingURL=data:'))
})

test('multiple formats', async (t) => {
Expand Down

0 comments on commit 10e2720

Please sign in to comment.