Skip to content

Commit e570031

Browse files
feat: add Less goToDefinition support (#192)
Co-authored-by: Brody McKee <[email protected]>
1 parent 56514cc commit e570031

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/helpers/getCssExports.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export const getCssExports = ({
7676
syncImport: true,
7777
filename: fileName,
7878
paths: [directory],
79+
sourceMap: true,
7980
...(rendererOptions.less ?? {}),
8081
} as Less.Options,
8182
(error?: Less.RenderError, output?: Less.RenderOutput) => {
@@ -85,6 +86,11 @@ export const getCssExports = ({
8586
if (output === undefined) {
8687
throw new Error('No Less output.');
8788
}
89+
90+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
91+
sourceMap = JSON.parse(output.map ?? 'undefined') as
92+
| RawSourceMap
93+
| undefined;
8894
transformedCss = output.css.toString();
8995
},
9096
);

0 commit comments

Comments
 (0)