模板配置复制 - '复制'在类型中不存在StencilConfig'

发布于 2025-02-11 07:39:59 字数 450 浏览 1 评论 0原文

我如何在模板配置中使用'复制',我正在尝试使所有 i18n.json 在汇编后可用。

export const config: Config = {
  namespace: 'components',
  plugins: [
    ...
  ],
  outputTargets: [
    ...
  ],
  copy: [
    {
      src: "**/*.i18n.*.json",
      dest: "i18n",
      warn: true
    }
  ],
};

错误:

复制:{src:string; dest:string;警告:布尔人; } []; }'不是 可分配给类型的“ concenconfig”

How can I use 'copy' in stencil config, I am trying to make all i18n.json be available after compilation.

export const config: Config = {
  namespace: 'components',
  plugins: [
    ...
  ],
  outputTargets: [
    ...
  ],
  copy: [
    {
      src: "**/*.i18n.*.json",
      dest: "i18n",
      warn: true
    }
  ],
};

Error:

copy: { src: string; dest: string; warn: boolean; }[]; }' is not
assignable to type 'StencilConfig'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

瑕疵 2025-02-18 07:39:59

复制任务已移至输出目标中(我认为在版本1中)。因此,只需将复制任务移至输出目标之一。

export const config: Config = {
  namespace: 'components',
  plugins: [
    ...
  ],
  outputTargets: [
    {
      type: 'www',
      copy: [
        {
          src: "**/*.i18n.*.json",
          dest: "i18n",
          warn: true
        }
      ],
    }
  ],
};

Here are the docs: https://stenciljs.com/docs /copy任务#复制任务 - for-of-of-of-of-tot-targets

Copy tasks have been moved into the output targets (I think in version 1). So simply move the copy task into one (or more) of your output targets.

export const config: Config = {
  namespace: 'components',
  plugins: [
    ...
  ],
  outputTargets: [
    {
      type: 'www',
      copy: [
        {
          src: "**/*.i18n.*.json",
          dest: "i18n",
          warn: true
        }
      ],
    }
  ],
};

Here are the docs: https://stenciljs.com/docs/copy-tasks#copy-tasks-for-output-targets

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文