Creation:2026-01-21Last update:2026-01-21
将此文档参考到您的 AI 助手ChatGPTClaudeDeepSeekGoogle AI modeGeminiPerplexityMistralGrok
使用您最喜欢的AI助手总结文档,并引用此页面和AI提供商
版本历史
- "Init doc"v8.0.02026/1/21
此页面的内容已使用 AI 翻译。
查看英文原文的最新版本Edit this doc
If you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.
GitHub link to the documentationCopy
Copy doc Markdown to clipboard
intlayer Vite 插件文档
intlayer Vite 插件将 Intlayer 配置集成到构建流程中。它处理词典别名,在开发模式下启动词典监听器,并为构建准备词典。
用法
ts
复制代码
复制代码到剪贴板
// vite.config.tsimport { defineConfig } from "vite";import { intlayer } from "vite-intlayer";export default defineConfig({ plugins: [intlayer()],});描述
该插件执行以下任务:
- 准备字典:在构建或开发过程开始时,将字典编译为优化后的文件。
- 监听模式:在开发模式下,它会监视字典文件的更改并自动重新编译。
- 别名:为在应用中访问字典提供别名。
- Tree-shaking:它通过
intlayerPrune插件支持对未使用的翻译进行 tree-shaking。