我在构建我的 ExtWebComponents 图表 Web 组件时遇到错误,没有匹配的文件,我该如何解决?

I get an error when I build my ExtWebComponents chart web component, no matching files, how do I resolve it?

当我构建我的 ExtWebComponents 应用程序时,出现此错误。

错误

ℹ「ext」:C2008:要求没有匹配的文件(Ext.chart.theme.Midnight)--/build/ext/manifest.js:0:13

其他形式的错误

我的配置

Ext.require([
  'Ext.chart.theme.Midnight',
  'Ext.chart.theme.Green',
  'Ext.chart.theme.Muted',
  'Ext.chart.theme.Purple',
  'Ext.chart.theme.Sky',
  'Ext.chart.series.Area',
  'Ext.chart.axis.Numeric',
  'Ext.chart.axis.Category'
]);

来源

为了解决这个错误,必须将 charts 包添加到 ExtWebpackPlugin。

new ExtWebpackPlugin({
  framework: 'web-components',
  toolkit: 'modern',
  theme: 'theme-material',
  emit: emit,
  script: './extract-code.js',
  port: 8080,
  packages: [
      'renderercell',
      'font-ext',
      'ux',
      'd3',
      'pivot-d3',
      'font-awesome',
      'exporter',
      'pivot',
      'calendar',
      'charts', // <<<<<------
      'treegrid',
      'froala-editor'
  ],
  profile: profile,
  environment: environment,
  treeshake: treeshake,
  browser: browser,
  watch: watch,
  verbose: verbose,
  inject: 'yes',
  intellishake: 'no'
})

示例:https://github.com/sencha/ext-web-components/blob/ext-web-components-7.1.x/packages/ext-web-components-kitchensink/webpack.config.js#L45