-
Notifications
You must be signed in to change notification settings - Fork 110
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
Generate a single JavaScript asset #42
Comments
I've also been wondering about this and looking through the code for answers. Even though the docs say that "it's not recommended for serious use", the |
I'm also wondering about this (I'd like to get a browser version of coffee2ls running) - but as well, this seems necessary if replacing CS 1.x is desired. |
I suggest using node-browserify to generate single file. |
I managed to use browserify to create a single file. I had to manually edit the original coffeescript in a few places and I had to rip out amdrequire stuff, which I think comes in from source-map. Anyway, here it is: https://gist.github.com/4005706 I managed to get a simple script ("four = 2 + 2") to parse, compile, and output as javascript and source map. I didn't check that the source map was valid. I'm not a javascript person, so I felt like a dog at the keyboard for most of this process. Hopefully this is helpful. |
related, untested commit: dfe5782 |
Browserify is working pretty well for me. I only have two issues: I can't get it to automatically export |
In Esmangle, creating entry point JavaScript file And because node-detective uses esprima and static analysis, we can remove dependency to some file by writing runModule = './run'
require runModule |
Firstly, this is incredibly cool. I'm in utter disbelief at how amazing this project turned out.
For most of my production work, I compile coffeescript to javascript as part of my build process using Mozilla Rhino. The standard coffeescript distribution includes a single coffee-script-1.3.3.js file. In my build process, I load this file into the JavaScript context and then call
CoffeeScript.compile(coffeeScriptSrc);
to retrieve my compiled output.However, the make output of CoffeeScriptRedux is split up into multiple files under
lib/coffeescript
with several dependencies (requirejs, etc). This works great in node and the command line, but I'm wondering how hard it would be to configure the Redux build to generate a single file for use outside the command line? I imagine this would also be useful for anyone compiling CoffeeScript in the browser itself.Alternatively, do you have any advice on the order in which I'd need to load each js file individually into the JavaScript context for compilation to work?
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/85549-generate-a-single-javascript-asset?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github).The text was updated successfully, but these errors were encountered: