@lark-apaas/fullstack-rspack-preset 0.1.2-alpha.6 → 0.1.2-alpha.7

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.d.ts CHANGED
@@ -35,4 +35,3 @@ import type { Configuration } from '@rspack/core';
35
35
  */
36
36
  export declare function createFullstackRspackConfig(overrides?: Partial<Configuration>): Configuration;
37
37
  export { createFullstackRspackConfig as defineConfig };
38
- export default createFullstackRspackConfig;
package/lib/index.js CHANGED
@@ -71,5 +71,3 @@ function createFullstackRspackConfig(overrides = {}) {
71
71
  // 5. 深度合并用户配置
72
72
  return (0, webpack_merge_1.merge)(baseConfig, overrides);
73
73
  }
74
- // 默认导出
75
- exports.default = createFullstackRspackConfig;
package/lib/preset.js CHANGED
@@ -129,7 +129,7 @@ function createRecommendRspackConfig(options) {
129
129
  'process.env.runtimeMode': JSON.stringify('fullstack'),
130
130
  'process.env.CLIENT_BASE_PATH': JSON.stringify(clientBasePath),
131
131
  // FIXME:安全漏洞,会读取到服务路径,不应该在客户端代码中使用
132
- 'process.env.CWD': JSON.stringify(process.cwd()),
132
+ 'process.env.CWD': JSON.stringify(''),
133
133
  // 解决 window 未定义问题
134
134
  'typeof window': JSON.stringify('object'),
135
135
  window: 'globalThis',
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@lark-apaas/fullstack-rspack-preset",
3
- "version": "0.1.2-alpha.6",
3
+ "version": "0.1.2-alpha.7",
4
4
  "files": [
5
- "lib"
5
+ "lib",
6
+ "preset.config.js"
6
7
  ],
7
8
  "main": "./lib/index.js",
8
9
  "types": "./lib/index.d.ts",
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Rspack extends 专用配置文件
3
+ *
4
+ * 使用方式:
5
+ * ```javascript
6
+ * module.exports = {
7
+ * extends: '@lark-apaas/fullstack-rspack-preset/preset.config.js',
8
+ * entry: { ... },
9
+ * }
10
+ * ```
11
+ */
12
+
13
+ const { createFullstackRspackConfig } = require('./lib/index');
14
+
15
+ // 直接导出配置对象(不是 exports.default)
16
+ module.exports = createFullstackRspackConfig();
@@ -1,3 +0,0 @@
1
- export = createReactRefreshPlugin;
2
- declare function createReactRefreshPlugin(): ReactRefreshPlugin;
3
- import ReactRefreshPlugin = require("@rspack/plugin-react-refresh/dist");
@@ -1,11 +0,0 @@
1
- "use strict";
2
- const ReactRefreshPlugin = require('@rspack/plugin-react-refresh');
3
- const path = require('path');
4
- function createReactRefreshPlugin() {
5
- return new ReactRefreshPlugin({
6
- overlay: {
7
- module: path.resolve(__dirname, 'overlay/index.js'),
8
- },
9
- });
10
- }
11
- module.exports = createReactRefreshPlugin;