Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/esbuild/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ export function macaronEsbuildPlugin({
const {
code,
result: [file, cssExtract],
} = await babelTransform(args.path);
} = await babelTransform(args.path, {
sourceMaps: build.initialOptions.sourcemap ? "inline" : false,
});

// the extracted code and original are the same -> no css extracted
if (file && cssExtract && cssExtract !== code) {
Expand Down
3 changes: 1 addition & 2 deletions packages/integration/src/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
macaronStyledComponentsPlugin,
} from '@macaron-css/babel';

export type BabelOptions = Omit<TransformOptions, 'ast' | 'filename' | 'root' | 'sourceFileName' | 'sourceMaps' | 'inputSourceMap'>;
export type BabelOptions = Omit<TransformOptions, 'ast' | 'filename' | 'root' | 'sourceFileName' | 'inputSourceMap'>;

export async function babelTransform(path: string, babel: BabelOptions = {}) {
const options: PluginOptions = { result: ['', ''], path };
Expand All @@ -20,7 +20,6 @@ export async function babelTransform(path: string, babel: BabelOptions = {}) {
...(Array.isArray(babel.presets) ? babel.presets : []),
'@babel/preset-typescript'
],
sourceMaps: false,
});

if (result === null || result.code === null)
Expand Down