Skip to content

Commit e64aef5

Browse files
committed
fix: local dev cannot proxy online
1 parent 69efc94 commit e64aef5

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

designer-demo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "cross-env vite",
8+
"dev:withAuth": "cross-env VITE_AUTH=true vite",
89
"build:alpha": "cross-env NODE_OPTIONS=--max-old-space-size=10240 vite build --mode alpha",
910
"build": "cross-env NODE_OPTIONS=--max-old-space-size=10240 vite build",
1011
"test": "vitest run",

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"scripts": {
55
"preinstall": "npx only-allow pnpm",
66
"dev": "pnpm run setup && concurrently 'pnpm:serve:backend' 'pnpm:serve:frontend'",
7+
"dev:withAuth": "pnpm run setup && pnpm --filter designer-demo dev:withAuth",
78
"serve:frontend": "pnpm --filter designer-demo dev",
89
"serve:backend": "pnpm --filter @opentiny/tiny-engine-mock dev",
910
"build:plugin": "pnpm --filter @opentiny/tiny-engine-* --filter @opentiny/tiny-engine build",

packages/design-core/registry.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ import {
5858
} from './re-export'
5959

6060
const isDevelopEnv = import.meta.env.MODE?.includes('dev')
61+
const useAuth = import.meta.env.VITE_AUTH === 'true'
62+
6163
window.__TINY_ENGINE_REMOVED_REGISTRY = {}
6264

6365
export default {
@@ -136,7 +138,7 @@ export default {
136138
}
137139
],
138140
enableTailwindCSS: true,
139-
enableLogin: isDevelopEnv ? false : true
141+
enableLogin: useAuth || !isDevelopEnv
140142
},
141143
layout: __TINY_ENGINE_REMOVED_REGISTRY['engine.layout'] === false ? null : Layout,
142144
toolbars: [

0 commit comments

Comments
 (0)