0👍
try to use imports-loader to adjust dependency context like this:
Install the loader with npm install imports-loader
and add it to loaders in your webpack configuration:
{
test: require.resolve('chart.js'),
use: 'imports-loader?this=>window'
}
- [Chartjs]-How to create two x-axes label using chart.js
- [Chartjs]-Chart.js: Widen hover distance for points
Source:stackexchange.com