I am porting legacy code to Webpack and I have the following...
Dependency loader in TS
@stream = new Bacon.Bus()
zone.js?fad3:269 Uncaught ReferenceError: Bacon is not defined
Module not found: Error: Cannot resolve module 'Bacon' in ...
The previous answer was on the right track but I was hesitant to have to include
Bacon = require("baconjs/dist/Bacon.js") on each coffee script file that required it. So I went ahead and added the following to my Typescript dependencies file...
window['Bacon'] = require('baconjs/dist/Bacon.js');
This seems to have worked and does not require a
require ;-) on each coffeescript file individually.
I originally tried
window.Bacon = require('baconjs/dist/Bacon.js');
But Typescript doesn't like it (How do you explicitly set a new property on `window` in TypeScript?)