@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 +0 -1
- package/lib/index.js +0 -2
- package/lib/preset.js +1 -1
- package/package.json +3 -2
- package/preset.config.js +16 -0
- package/lib/react-refresh-plugin.d.ts +0 -3
- package/lib/react-refresh-plugin.js +0 -11
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
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(
|
|
132
|
+
'process.env.CWD': JSON.stringify(''),
|
|
133
133
|
// 解决 window 未定义问题
|
|
134
134
|
'typeof window': JSON.stringify('object'),
|
|
135
135
|
window: 'globalThis',
|
package/package.json
CHANGED
package/preset.config.js
ADDED
|
@@ -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,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;
|