Comments (7)
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.
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.
I suggest using node-browserify to generate single file.
In esmangle project, we generate it by using browserify.
from coffeescriptredux.
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.
related, untested commit: dfe5782
from coffeescriptredux.
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.
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)
- CR after line continuation backslash leads to syntax error
- Switch doesn't work with the ternary operator HOT 2
- syntax error in javascript output when last function parameter is both a splat and a property HOT 9
- New line escaping (\) doesn't work in some cases
- What is the equivalent of require('coffee-script').compile(code, options);? HOT 3
- Is function declaration output possible HOT 2
- AST node ranges are not always correct HOT 7
- status? HOT 33
- ES6 support HOT 43
- REPL tests broken under iojs / new nodejs HOT 2
- Existential range slices HOT 1
- Assignment inside iterator scope HOT 1
- Project Status HOT 6
- JSON.parse stack traces break when using register HOT 1
- A static module system proposal for CS HOT 1
- -r command line option doesn't seem to work HOT 5
- feature request: compile to go and php HOT 2
- Confusing behaviour when inheriting from classes with bound methods HOT 1
- What's the state of this project? HOT 3
- Is project dead? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coffeescriptredux.