@lark-apaas/fullstack-rspack-preset 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -50,9 +50,7 @@ function createFullstackRspackConfig(overrides = {}) {
50
50
  }
51
51
  // 2. 从环境变量读取配置
52
52
  const isDev = process.env.NODE_ENV !== 'production';
53
- const enableReactRefresh = process.env.ENABLE_REACT_REFRESH
54
- ? process.env.ENABLE_REACT_REFRESH === 'true'
55
- : isDev;
53
+ const enableReactRefresh = isDev;
56
54
  // enableInspector 目前在 preset 内部由 isDev 控制,保留环境变量以备后续扩展
57
55
  // const enableInspector = process.env.ENABLE_INSPECTOR === 'true';
58
56
  const needRoutes = process.env.NEED_ROUTES !== 'false'; // 默认 true
@@ -33,14 +33,16 @@ function resgisterEchartsTheme() {
33
33
  isRegistered = true;
34
34
  // 打包后main.js defer 执行,css会加载完成
35
35
  (0, echarts_2.registerTheme)('ud', (0, registry_echarts_theme_1.getShadcnEChartsTheme)());
36
- // 监听hmr更新完成之后重新注册主题
37
- if (import.meta.webpackHot || module.hot) {
36
+ if (process.env.NODE_ENV === 'development') {
37
+ // 监听hmr更新完成之后重新注册主题
38
38
  const hot = import.meta.webpackHot || module.hot;
39
- hot.addStatusHandler(status => {
40
- if (status === 'idle') {
41
- (0, echarts_2.registerTheme)('ud', (0, registry_echarts_theme_1.getShadcnEChartsTheme)());
42
- }
43
- });
39
+ if (hot) {
40
+ hot.addStatusHandler(status => {
41
+ if (status === 'idle') {
42
+ (0, echarts_2.registerTheme)('ud', (0, registry_echarts_theme_1.getShadcnEChartsTheme)());
43
+ }
44
+ });
45
+ }
44
46
  }
45
47
  }
46
48
  resgisterEchartsTheme();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/fullstack-rspack-preset",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "files": [
5
5
  "lib",
6
6
  "preset.config.js"