@blocklet/component-studio-cli 0.6.63 → 0.6.65

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.
@@ -10,7 +10,7 @@ import { join, resolve, dirname, basename, relative } from 'node:path';
10
10
  import ora from 'ora';
11
11
  import os from 'os';
12
12
  import path from 'path';
13
- const DEFAULT_WORKSPACE_VERSION = '0.2.3';
13
+ const DEFAULT_WORKSPACE_VERSION = '0.2.5';
14
14
  const METADATA_FILE_NAME = '@metadata.json';
15
15
  export const BLOCKLET_INFO_DIR = '.blocklet-info';
16
16
  // 获取CLI内置的workspace模板路径
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/component-studio-cli",
3
- "version": "0.6.63",
3
+ "version": "0.6.65",
4
4
  "description": "CLI for Component Studio",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -7,9 +7,11 @@ import { createBlockletPlugin } from 'vite-plugin-blocklet';
7
7
  import svgr from 'vite-plugin-svgr';
8
8
 
9
9
  // https://vitejs.dev/config/
10
- export default defineConfig(async (mode) => {
10
+ export default defineConfig(async ({ mode }) => {
11
11
  const tailwindcss = await import('@tailwindcss/vite');
12
12
 
13
+ const isDev = mode === 'development';
14
+
13
15
  return {
14
16
  plugins: [
15
17
  react({
@@ -26,10 +28,25 @@ export default defineConfig(async (mode) => {
26
28
  resolve: {
27
29
  preserveSymlinks: true,
28
30
  alias: [
31
+ // @blocklet/pages-kit
29
32
  {
30
33
  find: /^@blocklet\/pages-kit(\/.*)?$/, // 匹配 @blocklet/pages-kit 及其子路径,确保有统一的上下文,能匹配 component studio 的依赖
31
- replacement: path.resolve(__dirname, 'node_modules/@blocklet/pages-kit/lib/esm') + '$1',
34
+ replacement: `${path.resolve(__dirname, 'node_modules/@blocklet/pages-kit/lib/esm')}$1`,
32
35
  },
36
+ ...(isDev
37
+ ? [
38
+ // @arcblock/ux
39
+ {
40
+ find: /^@arcblock\/ux(\/.*)?$/, // 匹配 @arcblock/ux 及其子路径,确保有统一的上下文,能匹配 component studio 的依赖
41
+ replacement: `${path.resolve(__dirname, 'node_modules/@arcblock/ux')}$1`,
42
+ },
43
+ // @mui/material
44
+ {
45
+ find: /^@mui\/material(\/.*)?$/, // 匹配 @mui/material 及其子路径,确保有统一的上下文,能匹配 component studio 的依赖
46
+ replacement: `${path.resolve(__dirname, 'node_modules/@mui/material')}$1`,
47
+ },
48
+ ]
49
+ : []),
33
50
  ],
34
51
  },
35
52