I'm currently testing a component that relies on a an external script with webpack externals.
DBPanel.js:
import React, { PureComponent } from 'react';
import $ from 'jquery';
And the webpack externals file looks like this:
webpack.config.js:
externals: {
jquery: "jQuery",
Materialize: "Materialize"
}
When I import the the file in my test import DBPanel from '../components/DBPanel';
I get this error:
Error: Cannot find module 'jquery'