Skip to content

Commit

Permalink
fix: babel jsx-runtime (#659)
Browse files Browse the repository at this point in the history
* fix: babel jsx-runtime

* chore: changeset

* fix: cr
  • Loading branch information
HomyeeKing authored Sep 27, 2024
1 parent dbe5150 commit b4c9dad
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/silly-grapes-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ice/pkg': patch
---

fix: babel jsx importSource
1 change: 1 addition & 0 deletions packages/pkg/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const JSX_RUNTIME_SOURCE = '@ice/jsx-runtime';
2 changes: 2 additions & 0 deletions packages/pkg/src/helpers/getBabelOptions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { TransformOptions } from '@babel/core';
import { BabelPluginOptions } from 'src/rollupPlugins/babel.js';
import { JSX_RUNTIME_SOURCE } from '../constants.js';

function getBabelOptions(
plugins: babel.PluginItem[],
Expand Down Expand Up @@ -27,6 +28,7 @@ function getBabelOptions(
jsxRuntime === 'automatic'
? {
runtime: jsxRuntime,
importSource: JSX_RUNTIME_SOURCE

Check failure on line 31 in packages/pkg/src/helpers/getBabelOptions.ts

View workflow job for this annotation

GitHub Actions / CI (18)

Missing trailing comma
}
: {
pragma,
Expand Down
2 changes: 1 addition & 1 deletion packages/pkg/src/rollupPlugins/swc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import MagicString from 'magic-string';
import type { Options as SwcCompileOptions, Config, TsParserConfig, EsParserConfig } from '@swc/core';
import type { TaskConfig, OutputFile, BundleTaskConfig } from '../types.js';
import type { Plugin } from 'rollup';
import { JSX_RUNTIME_SOURCE } from '../constants.js';

const JSX_RUNTIME_SOURCE = '@ice/jsx-runtime';

const normalizeSwcConfig = (
file: OutputFile,
Expand Down

0 comments on commit b4c9dad

Please sign in to comment.