I know we need typings file for wow.js but I couldn't find it anywhere. Is there any other solution for loading this external js into webpack?
Do the following steps:
npm i exports-loader --save-dev
webpack.config.js
this loader
{ test: require.resolve('wow.js/dist/wow.js'), loader: 'exports?this.WOW' }
typings.d.ts
file in your typings folder:
declare module "wow.js/dist/wow.js" { var noTypeInfoYet: any; export = noTypeInfoYet; }
*.component.ts
file
import * as WOW from 'wow.js/dist/wow.js';
ngOnInit(){ new WOW().init(); }
Of course you can use your own webpack configuration without exports-loader
, etc...