Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't require in Typescript/Webpack file #19

Open
jrgleason opened this issue Sep 21, 2016 · 0 comments
Open

Can't require in Typescript/Webpack file #19

jrgleason opened this issue Sep 21, 2016 · 0 comments

Comments

@jrgleason
Copy link

I am trying to upgrade an existing project to Typescript. I have the following lines...

In legacy .coffee

@refreshAfter = after -> @thing.refresh();
@updateBefore = before -> @thing.update();
@refreshAndUpdate = @updateBefore @refreshAfter
@updateThings    = @refreshAndUpdate (opts) -> doSomething(); // ...

Just to make sure I understand what this is doing when updateThings() is called it runs

  1. refreshAfter
  2. doSomething
  3. updateBefore

Then in my TS file I have

window['_'] = require("underscore");
require("YouAreDaChef");
// Also tried
// window['chef'] = require("YouAreDaChef");

When I run I get

ReferenceError: after is not defined

Is there something special I have to do with the module loader? Pass window to it or something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant