Giter Club home page Giter Club logo

Comments (7)

osuushi avatar osuushi commented on May 27, 2024

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 <script type="text/coffeescript"> feature of the original compiler is a lifesaver during development, especially when using a web host with no server side JS capabilities.

from coffeescriptredux.

gkz avatar gkz commented on May 27, 2024

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.

from coffeescriptredux.

Constellation avatar Constellation commented on May 27, 2024

I suggest using node-browserify to generate single file.
In esmangle project, we generate it by using browserify.

from coffeescriptredux.

samwgoldman avatar samwgoldman commented on May 27, 2024

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.

from coffeescriptredux.

michaelficarra avatar michaelficarra commented on May 27, 2024

related, untested commit: dfe5782

from coffeescriptredux.

michaelficarra avatar michaelficarra commented on May 27, 2024

Browserify is working pretty well for me. I only have two issues: I can't get it to automatically export CoffeeScript (probably an option I'm missing), and I can't get it to automatically ignore /lib/coffee-script/run.js, which is needed to ignore the unsupported native module module. Currently, building the browser version requires manually deleting the require('./run') line in /lib/coffee-script/module.js and manually adding var CoffeeScript = ... to the output. I'm working on fixing these minor issues.

from coffeescriptredux.

Constellation avatar Constellation commented on May 27, 2024

I can't get it to automatically export CoffeeScript (probably an option I'm missing)

In Esmangle, creating entry point JavaScript file tools/entry.js and doing browserify tools/entry.js.
https://github.com/Constellation/esmangle/blob/master/tools/entry.js

And because node-detective uses esprima and static analysis, we can remove dependency to some file by writing

runModule = './run'
require runModule

from coffeescriptredux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.