Skip to content

Commit 7fc9047

Browse files
Haroenvsarahdayan
andauthored
fix(babel): remove jsx pragma comment in output (#14)
* fix(babel): remove jsx pragma comment in output This could cause issues in modern environments where the jsx environment is set to auto, which doesn't allow `@jsx` comments. As the source file is compiled there won't be a difference in functionality. ```diff diff --git a/packages/highlight-vdom/dist/esm/Highlight.js b/packages/highlight-vdom/dist/esm/Highlight.d.ts-pre index bdba7e0..ab25463 100644 --- a/packages/highlight-vdom/dist/esm/Highlight.js +++ b/packages/highlight-vdom/dist/esm/Highlight.d.ts-pre @@ -1,8 +1,6 @@ import _extends from "@babel/runtime/helpers/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; var _excluded = ["parts", "highlightedTagName", "nonHighlightedTagName", "separator", "className", "classNames"]; - -/** @jsx createElement */ import { cx } from '@algolia/ui-components-shared'; function createHighlightPartComponent(_ref) { ``` * Update babel.config.js Co-authored-by: Sarah Dayan <[email protected]> Co-authored-by: Sarah Dayan <[email protected]>
1 parent 9bcee85 commit 7fc9047

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: babel.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,7 @@ module.exports = (api) => {
3232
},
3333
],
3434
],
35+
// JSX is transpiled, so the comment should no longer be present in final files
36+
shouldPrintComment: (value) => !value.startsWith('* @jsx'),
3537
};
3638
};

0 commit comments

Comments
 (0)