Skip to content

Commit

Permalink
fix: invalid i18n source
Browse files Browse the repository at this point in the history
introduce emergency fix
  • Loading branch information
dragon-fish authored Oct 18, 2023
2 parents 717f52d + d310506 commit cdce455
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"build:compressed": "cross-env MINIFY=1 vite build",
"prepublish": "npm run build",
"lint": "eslint ./src",
"dev": "vite",
"dev": "cross-env NODE_ENV=development && run-p dev:*",
"dev:preview": "vite preview",
"dev:build": "vite build --mode development --watch",
"clear": "rimraf dist",
"pretty": "prettier --write ./src"
},
Expand Down
6 changes: 5 additions & 1 deletion src/method/syncI18nData.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ const config = mw.config.get()

// 设置
const cacheTime = 2 * 60 * 60 * 1000
const cacheUrl = resolvePath('/i18n/languages.json')
const cacheUrl = resolvePath(
import.meta.env.MODE === 'development'
? '/i18n/languages.json'
: '/dist/i18n/languages.json'
)
const funcName = 'InPageEdit'
const localCacheName = 'i18n-cache-' + funcName + '-content'
const localCacheTime = 'i18n-cache-' + funcName + '-timestamp'
Expand Down
1 change: 1 addition & 0 deletions vite.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default defineConfig({
emptyOutDir: false,
sourcemap: true,
},
mode: process.env.NODE_ENV,
server: {
host: true,
port: 1005,
Expand Down

0 comments on commit cdce455

Please sign in to comment.