I'm using Angular 4 with webpack and I'm not able to use a jQuery plugin,with angular cli it works,with webpack not
I've included the plugin in webpack.config.vendor.js
const treeShakableModules = [
.....
'@angular/router',
'zone.js',
'virtual-keyboard',
If i check the source page at
script src="/dist/vendor.js?v=SsiHzOEk9BPk3CnH6ivS_kkChKmOOxXsB-fFyDO1R8w"></script>
I can find the js plugin code
In my .ts code I have
import * as $ from 'jquery';
....
$('#mycontrol').css('background-color', 'red');// I see the change so jQuery works
(<any>$('#mycontrol')).keyboard();
In console I got this error: $(...).keyboard is not a function
with angular cli works very simple with this code
declare var $: any;
$('#mycontrol').keyboard();
thanks