Skip to content

Commit f693484

Browse files
authored
fix: escape vite parse import.meta.env var on build phrase (#1364)
1 parent dea9e8c commit f693484

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/api/frontend-api/preview-api.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@
1313

1414
适用场景:仅修改跳转 url,不修改 query 查询字符串部分,比如:
1515

16-
```javascript
16+
<pre>
17+
<code>
1718
import { Preview } from '@opentiny/tiny-engine'
1819
export default {
1920
toolbars: [
20-
[Preview, { options: { ...Preview.options, previewUrl: import.meta.env.MODE.includes('prod') ? 'http://tiny-engine-preview.com/customPreview' : '' } }]
21+
[Preview, { options: { ...Preview.options, previewUrl: import.meta<wbr>.env.MODE.includes('prod') ? 'http://tiny-engine-preview.com/customPreview' : '' } }]
2122
]
2223
}
23-
```
24+
</code>
25+
</pre>
2426

2527
配置完成之后,在生产环境,TinyEngine 会增加必要的 query部分,然后跳转到配置的 url,比如:`http://tiny-engine-preview.com/customPreview?tenant=1&id=1&...`
2628

0 commit comments

Comments
 (0)