[Chartjs]-Webpack `this` not pointing to window (Chart.js breaks)

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'
}

Leave a comment