@itcase/storybook-config 1.2.68 → 1.2.69

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.
@@ -1,5 +1,7 @@
1
1
  import svgr from 'vite-plugin-svgr'
2
2
 
3
+ import { getMediaProxyServerConfig } from '../vite/getMediaProxyServerConfig.js'
4
+
3
5
  const MAIN_CONFIG_NEXTJS_VITE = {
4
6
  env: (config) => ({
5
7
  ...config,
@@ -24,6 +26,7 @@ const MAIN_CONFIG_NEXTJS_VITE = {
24
26
  ...config.resolve,
25
27
  tsconfigPaths: true,
26
28
  },
29
+ ...getMediaProxyServerConfig(),
27
30
  })
28
31
  },
29
32
  core: {
@@ -2,6 +2,8 @@ import path from 'node:path'
2
2
 
3
3
  import svgr from 'vite-plugin-svgr'
4
4
 
5
+ import { getMediaProxyServerConfig } from '../vite/getMediaProxyServerConfig.js'
6
+
5
7
  const MAIN_CONFIG_VITE = {
6
8
  viteFinal: async function (config) {
7
9
  const { mergeConfig } = await import('vite')
@@ -65,6 +67,7 @@ const MAIN_CONFIG_VITE = {
65
67
  : {}),
66
68
  usePolling: false,
67
69
  },
70
+ ...getMediaProxyServerConfig().server,
68
71
  },
69
72
  })
70
73
  },
@@ -0,0 +1,19 @@
1
+ function getMediaProxyServerConfig() {
2
+ const restBaseUrl = process.env.REST_BASE_URL?.replace(/\/$/, '')
3
+ if (!restBaseUrl) {
4
+ return {}
5
+ }
6
+
7
+ return {
8
+ server: {
9
+ proxy: {
10
+ '/media': {
11
+ changeOrigin: true,
12
+ target: restBaseUrl,
13
+ },
14
+ },
15
+ },
16
+ }
17
+ }
18
+
19
+ export { getMediaProxyServerConfig }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/storybook-config",
3
- "version": "1.2.68",
3
+ "version": "1.2.69",
4
4
  "author": "ITCase",
5
5
  "description": "Storybook configuration package",
6
6
  "engines": {
@@ -142,7 +142,7 @@
142
142
  "@itcase/common": "^1.2.43",
143
143
  "@itcase/lint": "^1.1.116",
144
144
  "@itcase/ui-core": "^1.10.2",
145
- "@itcase/ui-web": "^1.10.3",
145
+ "@itcase/ui-web": "^1.10.6",
146
146
  "@react-native-community/cli": "20.1.3",
147
147
  "@react-native-community/cli-platform-android": "20.1.3",
148
148
  "@react-native-community/cli-platform-ios": "20.1.3",