Skip to content

Commit

Permalink
fix: config
Browse files Browse the repository at this point in the history
  • Loading branch information
ClarkXia committed Mar 3, 2023
1 parent 9cd2230 commit ed29192
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/webpack-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ export function getWebpackConfig(options: GetWebpackConfigOptions): Configuratio
...plugins,
...compilerWebpackPlugins,
// @ts-ignore
new EnvReplacementPlugin(),
dev && new EnvReplacementPlugin(),
dev && fastRefresh && new ReactRefreshWebpackPlugin({
exclude: [/node_modules/, /bundles[\\\\/]compiled/],
// use webpack-dev-server overlay instead
Expand Down
2 changes: 2 additions & 0 deletions packages/webpack-config/src/unPlugins/compilation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ function getJsxTransformOptions({
rootDir,
}: GetJsxTransformOptions) {
const reactTransformConfig: ReactConfig = {
// Swc won't enable fast refresh when development is false in the latest version.
development: mode === 'development',
refresh: fastRefresh,
runtime: 'automatic',
importSource: '@ice/runtime', // The exact import source is '@ice/runtime/jsx-runtime'
Expand Down

0 comments on commit ed29192

Please sign in to comment.