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

Supporting Source Maps #54

Open
valtido opened this issue Jul 29, 2014 · 1 comment
Open

Supporting Source Maps #54

valtido opened this issue Jul 29, 2014 · 1 comment

Comments

@valtido
Copy link

valtido commented Jul 29, 2014

I think this line of code should change:
https://github.com/sintaxi/terraform/blob/master/lib/javascript/processors/coffee.js#L7

From: 
var script = cs.compile(fileContents.toString(), { bare: true })
To:
var useMaps = process.env.coffee_map || process.env.NODE_ENV=="dev"?true:false;
var script = cs.compile(fileContents.toString(), { bare: true , map : useMaps })

I have not tested this, but I think then we can do something like

coffee_map=true harp server app.js
//or maybe
NODE_ENV=dev harp server app.js

I wanted to make the change, but not sure, I should at this point in time. Any thoughts, or am I completely getting this wrong?

@kennethormandy
Copy link
Collaborator

Hey, thanks for opening an issue!

Terraform / Harp already supports the Node Environment variables, yeah, so that’d be the way to go. I’m not the best person to ask about how this should be implemented, but we definitely would like to see source maps for all the preprocessors per sintaxi/harp#74

If you’re interested in contribute that, we’d be super grateful and can put together a better explanation of the expected behaviour.

jimjkelly referenced this issue in jimjkelly/terraform Jul 20, 2016
configurable via .babelrc file. Additionally, it removes
the concept of processors for JS (other than providing a
list of supported extensions, coonsistent with the rest of
Terraform), allowing Coffeescript to be transformed by
browserify.

It should be noted that this does not currently pass all
tests, but does seem to work for the stated purposes. Work
is ongoing.
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

2 participants