@blocklet/pages-kit-block-studio 0.0.3 → 0.0.4
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 +17 -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 +17 -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
|
@@ -8,20 +8,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
export function generateWrapperCode(_a) {
|
|
11
|
-
return __awaiter(this, arguments, void 0, function* ({ project, state }) {
|
|
11
|
+
return __awaiter(this, arguments, void 0, function* ({ project, state, version }) {
|
|
12
12
|
const projectName = (project.name || project.id).toLowerCase().replaceAll(/[^a-z0-9]/g, '_');
|
|
13
13
|
const packageName = `@pages-kit-project/${projectName}`;
|
|
14
14
|
const packageJson = JSON.stringify({
|
|
15
15
|
name: packageName,
|
|
16
|
-
version: '0.0.1',
|
|
16
|
+
version: version || '0.0.1',
|
|
17
17
|
main: 'index.cjs',
|
|
18
18
|
module: 'index.js',
|
|
19
19
|
types: 'index.d.ts',
|
|
20
|
-
peerDependencies: {
|
|
21
|
-
'@blocklet/pages-kit-runtime': 'latest',
|
|
22
|
-
'@blocklet/pages-kit-inner-components': 'latest',
|
|
23
|
-
'@blocklet/pages-kit': 'latest',
|
|
24
|
-
},
|
|
25
20
|
dependencies: {
|
|
26
21
|
'@blocklet/pages-kit-runtime': 'latest',
|
|
27
22
|
'@blocklet/pages-kit-inner-components': 'latest',
|
|
@@ -75,13 +75,26 @@ export function initBlockStudioPlugins(options) {
|
|
|
75
75
|
fileName: (format, entryName) => `${format}/${entryName}.js`,
|
|
76
76
|
},
|
|
77
77
|
rollupOptions: {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
external: [
|
|
79
|
+
'react',
|
|
80
|
+
'react-router-dom',
|
|
81
|
+
'react-dom',
|
|
82
|
+
'crypto',
|
|
83
|
+
'@emotion/react',
|
|
84
|
+
'@emotion/styled',
|
|
85
|
+
'@arcblock/ux',
|
|
86
|
+
/^@mui\/.*/, // 所有 MUI 相关包
|
|
87
|
+
],
|
|
81
88
|
output: {
|
|
82
|
-
//
|
|
89
|
+
// 为所有外部依赖提供全局变量
|
|
83
90
|
globals: {
|
|
84
91
|
react: 'React',
|
|
92
|
+
'react-dom': 'ReactDOM',
|
|
93
|
+
'react-router-dom': 'ReactRouterDOM',
|
|
94
|
+
'@emotion/react': 'emotionReact',
|
|
95
|
+
'@emotion/styled': 'emotionStyled',
|
|
96
|
+
'@mui/material': 'MUI',
|
|
97
|
+
'@arcblock/ux': 'ArcBlockUX',
|
|
85
98
|
},
|
|
86
99
|
paths: {
|
|
87
100
|
// Redirect 'react' imports to '@blocklet/pages-kit/builtin/react'
|