@lark-apaas/fullstack-rspack-preset 1.0.50-alpha.1 → 1.0.50

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.
Files changed (2) hide show
  1. package/lib/preset.js +11 -13
  2. package/package.json +2 -2
package/lib/preset.js CHANGED
@@ -29,8 +29,6 @@ function sendBackendUnavailable502(_err, _req, res) {
29
29
  });
30
30
  res.end(JSON.stringify({ error: 'Bad Gateway', message: 'Backend service is not running' }));
31
31
  }
32
- // 检查是否启用宽松 build 模式
33
- const isLooseMode = process.env.FORCE_FRAMEWORK_BUILD_LOOSE_MODE === 'true';
34
32
  function readAppFlags(rootDir) {
35
33
  try {
36
34
  return JSON.parse(fs_1.default.readFileSync(path_1.default.resolve(rootDir, 'package.json'), 'utf-8')).flags || {};
@@ -148,16 +146,16 @@ function createRecommendRspackConfig(options) {
148
146
  {
149
147
  test: /\.tsx?$/,
150
148
  use: [
151
- ...(isLooseMode ? [{
152
- loader: require.resolve('babel-loader'),
153
- options: {
154
- plugins: [
155
- [
156
- require.resolve('@lark-apaas/styled-jsx/babel'),
157
- ]
149
+ {
150
+ loader: require.resolve('babel-loader'),
151
+ options: {
152
+ plugins: [
153
+ [
154
+ require.resolve('@lark-apaas/styled-jsx/babel'),
158
155
  ]
159
- },
160
- }] : []),
156
+ ]
157
+ },
158
+ },
161
159
  {
162
160
  loader: 'builtin:swc-loader',
163
161
  options: {
@@ -179,8 +177,8 @@ function createRecommendRspackConfig(options) {
179
177
  experimental: {
180
178
  // 避免 wasm 出现到根目录,统一放到 node_modules/.cache 目录下
181
179
  cacheRoot: path_1.default.join(rootDir, './node_modules/.cache/swc'),
182
- // 支持 styled-jsx 语法
183
- plugins: [isLooseMode ? null : [require.resolve('@swc/plugin-styled-jsx'), {}]].filter(Boolean),
180
+ // styled-jsx 统一由 babel-loader 处理,不再使用 @swc/plugin-styled-jsx(SWC 插件存在编译卡死问题)
181
+ plugins: [],
184
182
  },
185
183
  },
186
184
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/fullstack-rspack-preset",
3
- "version": "1.0.50-alpha.1",
3
+ "version": "1.0.50",
4
4
  "files": [
5
5
  "lib",
6
6
  "patches",
@@ -31,7 +31,7 @@
31
31
  "@babel/parser": "^7.28.0",
32
32
  "@babel/traverse": "^7.28.0",
33
33
  "@babel/types": "^7.28.2",
34
- "@lark-apaas/devtool-kits": "1.2.17-alpha.53",
34
+ "@lark-apaas/devtool-kits": "^1.2.20",
35
35
  "@lark-apaas/miaoda-inspector-babel-plugin": "^1.0.2",
36
36
  "@lark-apaas/styled-jsx": "^1.0.1",
37
37
  "@rspack/plugin-react-refresh": "^1.5.1",