@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
|
@@ -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,13 +111,26 @@ 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
|
+
],
|
|
117
124
|
output: {
|
|
118
|
-
//
|
|
125
|
+
// 为所有外部依赖提供全局变量
|
|
119
126
|
globals: {
|
|
120
127
|
react: 'React',
|
|
128
|
+
'react-dom': 'ReactDOM',
|
|
129
|
+
'react-router-dom': 'ReactRouterDOM',
|
|
130
|
+
'@emotion/react': 'emotionReact',
|
|
131
|
+
'@emotion/styled': 'emotionStyled',
|
|
132
|
+
'@mui/material': 'MUI',
|
|
133
|
+
'@arcblock/ux': 'ArcBlockUX',
|
|
121
134
|
},
|
|
122
135
|
paths: {
|
|
123
136
|
// Redirect 'react' imports to '@blocklet/pages-kit/builtin/react'
|