Follow these steps:
- Install exports-loader
npm i exports-loader --save-dev
- Add this loader to
webpack.config.js {
test: require.resolve ('wow.js / dist / wow.js'),
loader: 'exports? this.WOW'
}
- Create a
typings.d.ts file in the samples folder: declare module "wow.js / dist / wow.js" {
var noTypeInfoYet: any;
export = noTypeInfoYet;
}
- add import to your
*.component.ts file import * as WOW from 'wow.js / dist / wow.js';
- Use it well!
ngOnInit () {
new WOW (). init ();
}
Of course, you can use your own webpack configuration without exports-loader , etc.
source share