@snack-kit/scripts 0.3.0 → 0.4.0
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/README.md +6 -0
- package/config/webpack.shared.js +11 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -142,6 +142,12 @@ module.exports = (config) => {
|
|
|
142
142
|
|
|
143
143
|
## Changelog
|
|
144
144
|
|
|
145
|
+
### 0.4.0
|
|
146
|
+
|
|
147
|
+
- 修复:调试窗口 topbar 工具区样式细节优化
|
|
148
|
+
- 修复:启动调试运行错误的问题
|
|
149
|
+
- 修复:修复 core 依赖版本错误的问题
|
|
150
|
+
|
|
145
151
|
### 0.3.0
|
|
146
152
|
|
|
147
153
|
- 新增:调试窗口 topbar 视口尺寸切换(PC / Tablet / Mobile / 自定义),偏好持久化到 localStorage
|
package/config/webpack.shared.js
CHANGED
|
@@ -89,7 +89,17 @@ function createResolve(extraAlias = {}) {
|
|
|
89
89
|
package: path.join(process.env.PROJECT_PATH, 'src/package'),
|
|
90
90
|
assets: path.join(process.env.PROJECT_PATH, 'src/assets'),
|
|
91
91
|
// @snack-kit/core 的 package.json module 字段路径有误,直接指向 cjs
|
|
92
|
-
|
|
92
|
+
// 优先使用宿主项目安装的 @snack-kit/core,fallback 到 scripts 自身的(兼容 file: 软链)
|
|
93
|
+
'@snack-kit/core': (() => {
|
|
94
|
+
const projectCorePath = process.env.PROJECT_PATH
|
|
95
|
+
? path.join(process.env.PROJECT_PATH, 'node_modules/@snack-kit/core/dist/cjs/index.js')
|
|
96
|
+
: null;
|
|
97
|
+
const scriptsCorePath = path.resolve(__dirname, '../node_modules/@snack-kit/core/dist/cjs/index.js');
|
|
98
|
+
if (projectCorePath) {
|
|
99
|
+
try { require.resolve(projectCorePath); return projectCorePath; } catch (_) {}
|
|
100
|
+
}
|
|
101
|
+
return scriptsCorePath;
|
|
102
|
+
})(),
|
|
93
103
|
// 优先使用宿主项目自己的 react,保证 React 版本与项目一致(兼容 React 17/18/19)
|
|
94
104
|
// react/react-dom 使用目录别名(不加 $),使子路径(如 react/jsx-runtime)也走项目自身版本
|
|
95
105
|
// react-dom/client 比 react-dom 更长,enhanced-resolve 会优先匹配更具体的 key
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snack-kit/scripts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "snack-cli package scripts Powered by Para FED",
|
|
5
5
|
"bin": {
|
|
6
6
|
"snack-scripts": "./bin/main.js"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
|
|
36
36
|
"react": "^19.0.0",
|
|
37
37
|
"react-dom": "^19.0.0",
|
|
38
|
-
"@snack-kit/core": "
|
|
38
|
+
"@snack-kit/core": "^0.3.0",
|
|
39
39
|
"@snack-kit/lib": "^0.6.0",
|
|
40
40
|
"@swc/core": "^1.2.100",
|
|
41
41
|
"babel-loader": "^9.1.3",
|