diff --git a/src/esbuild/index.ts b/src/esbuild/index.ts index 448da15c..b9f52236 100644 --- a/src/esbuild/index.ts +++ b/src/esbuild/index.ts @@ -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, diff --git a/src/options.ts b/src/options.ts index 5be70077..df37a3d8 100644 --- a/src/options.ts +++ b/src/options.ts @@ -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 */ diff --git a/test/index.test.ts b/test/index.test.ts index c2fc109c..12550114 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -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) => {