After spending most of the day in search engines and trying - I did not get it to work, and at the moment I am not sure what is missing.
I already have jQuery working (and verified it works) in webpack.common.js:
new ProvidePlugin({
jQuery: 'jquery',
$: 'jquery',
jquery: 'jquery'
})
For example, I have a plugin "MetisMenu", where to configure it?
I tried various combinations require/includein my .module.ts application.
Similarly (including assigning them a constant / var, but import / require always give this error):
import 'metismenu';
jQuery(...).metisMenu is not a function
import { metisMenu } from 'metismenu';
Cannot assign to read only property 'exports' of object '#<Object>'
require ('metismenu');
Cannot assign to read only property 'exports' of object '#<Object>'
import * as jQuery from 'jquery';
import "metismenu";
Cannot assign to read only property 'exports' of object '#<Object>'
Agony source
share