我在构建我的 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
其他形式的错误
- 从源 'null' 访问 'file:///Users/branflake2267/git/sandbox-ewc/dash-metrics/dash-metrics-client/build/widget/cartesian.js' 处的 XMLHttpRequest 已被 CORS 策略阻止:跨源请求仅支持协议方案:http、数据、chrome、chrome-扩展名,https.
我的配置
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'
})
当我构建我的 ExtWebComponents 应用程序时,出现此错误。
错误
ℹ「ext」:C2008:要求没有匹配的文件(Ext.chart.theme.Midnight)--/build/ext/manifest.js:0:13
其他形式的错误
- 从源 'null' 访问 'file:///Users/branflake2267/git/sandbox-ewc/dash-metrics/dash-metrics-client/build/widget/cartesian.js' 处的 XMLHttpRequest 已被 CORS 策略阻止:跨源请求仅支持协议方案:http、数据、chrome、chrome-扩展名,https.
我的配置
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'
})