@blocklet/pages-kit-block-studio 0.0.3 → 0.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/cjs/block-studio/generate-wrapper-code.js +2 -7
- package/lib/cjs/block-studio/plugins/vite-plugin-block-studio.js +21 -4
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/block-studio/generate-wrapper-code.js +2 -7
- package/lib/esm/block-studio/plugins/vite-plugin-block-studio.js +21 -4
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/types/block-studio/generate-wrapper-code.d.ts +1 -1
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -44,20 +44,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
44
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
45
|
exports.generateWrapperCode = generateWrapperCode;
|
|
46
46
|
function generateWrapperCode(_a) {
|
|
47
|
-
return __awaiter(this, arguments, void 0, function* ({ project, state }) {
|
|
47
|
+
return __awaiter(this, arguments, void 0, function* ({ project, state, version }) {
|
|
48
48
|
const projectName = (project.name || project.id).toLowerCase().replaceAll(/[^a-z0-9]/g, '_');
|
|
49
49
|
const packageName = `@pages-kit-project/${projectName}`;
|
|
50
50
|
const packageJson = JSON.stringify({
|
|
51
51
|
name: packageName,
|
|
52
|
-
version: '0.0.1',
|
|
52
|
+
version: version || '0.0.1',
|
|
53
53
|
main: 'index.cjs',
|
|
54
54
|
module: 'index.js',
|
|
55
55
|
types: 'index.d.ts',
|
|
56
|
-
peerDependencies: {
|
|
57
|
-
'@blocklet/pages-kit-runtime': 'latest',
|
|
58
|
-
'@blocklet/pages-kit-inner-components': 'latest',
|
|
59
|
-
'@blocklet/pages-kit': 'latest',
|
|
60
|
-
},
|
|
61
56
|
dependencies: {
|
|
62
57
|
'@blocklet/pages-kit-runtime': 'latest',
|
|
63
58
|
'@blocklet/pages-kit-inner-components': 'latest',
|
|
@@ -111,18 +111,35 @@ function initBlockStudioPlugins(options) {
|
|
|
111
111
|
fileName: (format, entryName) => `${format}/${entryName}.js`,
|
|
112
112
|
},
|
|
113
113
|
rollupOptions: {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
external: [
|
|
115
|
+
'react',
|
|
116
|
+
'react-router-dom',
|
|
117
|
+
'react-dom',
|
|
118
|
+
'crypto',
|
|
119
|
+
'@emotion/react',
|
|
120
|
+
'@emotion/styled',
|
|
121
|
+
'@arcblock/ux',
|
|
122
|
+
/^@mui\/.*/, // 所有 MUI 相关包
|
|
123
|
+
'@mui/material/styles', // 明确指定这个路径
|
|
124
|
+
],
|
|
117
125
|
output: {
|
|
118
|
-
//
|
|
126
|
+
// 为所有外部依赖提供全局变量
|
|
119
127
|
globals: {
|
|
120
128
|
react: 'React',
|
|
129
|
+
'react-dom': 'ReactDOM',
|
|
130
|
+
'react-router-dom': 'ReactRouterDOM',
|
|
131
|
+
'@emotion/react': 'emotionReact',
|
|
132
|
+
'@emotion/styled': 'emotionStyled',
|
|
133
|
+
'@mui/material': 'MUI',
|
|
134
|
+
'@arcblock/ux': 'ArcBlockUX',
|
|
121
135
|
},
|
|
122
136
|
paths: {
|
|
123
137
|
// Redirect 'react' imports to '@blocklet/pages-kit/builtin/react'
|
|
124
138
|
// react: '@blocklet/pages-kit/builtin/react',
|
|
125
139
|
},
|
|
140
|
+
// 确保正确处理命名导出和默认导出
|
|
141
|
+
interop: 'auto',
|
|
142
|
+
preserveModules: true, // 保持模块结构
|
|
126
143
|
},
|
|
127
144
|
},
|
|
128
145
|
},
|