Creation:2024-08-11Last update:2025-11-22
将此文档参考到您的 AI 助手ChatGPTClaudeDeepSeekGoogle AI modeGeminiPerplexityMistralGrok
使用您最喜欢的AI助手总结文档,并引用此页面和AI提供商
版本历史
- "添加 checkTypes 选项"v8.1.52026/2/23
此页面的内容已使用 AI 翻译。
查看英文原文的最新版本编辑此文档
如果您有改善此文档的想法,请随时通过在GitHub上提交拉取请求来贡献。
文档的 GitHub 链接Copy
复制文档 Markdown 到剪贴板
构建字典
要构建您的字典,您可以运行以下命令:
bash
复制代码
复制代码到剪贴板
npx intlayer build或者使用监听模式
bash
复制代码
复制代码到剪贴板
npx intlayer build --watch该命令默认会查找您的声明内容文件,路径为 ./src/**/*.content.{ts|js|mjs|cjs|json|tsx|jsx}。并在 .intlayer 目录中构建字典。
别名:
npx intlayer dictionaries buildnpx intlayer dictionary buildnpx intlayer dic build
参数:
--base-dir:指定项目的基础目录。为了获取 intlayer 配置,命令会在基础目录中查找intlayer.config.{ts,js,json,cjs,mjs}文件。示例:
npx intlayer build --base-dir ./src--env:指定环境(例如,development、production)。当您在 intlayer 配置文件中使用环境变量时非常有用。示例:
npx intlayer build --env production--env-file:提供自定义环境文件以加载变量。当您在 intlayer 配置文件中使用环境变量时非常有用。示例:
npx intlayer build --env-file .env.production.local--with:与构建命令并行启动其他命令。示例:
npx intlayer build --with "next dev --turbopack"--skip-prepare:跳过准备步骤。示例:
npx intlayer build --skip-prepare--no-cache:禁用缓存。示例:
npx intlayer build --no-cache--check-types: 检查内容声明文件的类型。示例:
npx intlayer build --check-types