Comments (8)
Error stack for reference:
./node_modules/.bin/browserify test.coffee -t workerify
/Users/drewstokes/Code/lincx/axle/node_modules/workerify/node_modules/falafel/node_modules/esprima/esprima.js:3817
throw e;
^
Error: Line 1: Unexpected string
at throwError (/Users/drewstokes/Code/lincx/axle/node_modules/workerify/node_modules/falafel/node_modules/esprima/esprima.js:1456:21)
...
from workerify.
You should be able to do browserify test.coffee -t coffeeify -t workerify
but I just tried that and it doesn't work. I don't know why.
from workerify.
@shama browserify doesn't change the name of compiled coffeescript files, so the extensions are still .coffee
which are subsequently excluded by the regex check in the first line of module.exports.
from workerify.
changing /\.js/
to /\.(js|coffee)/
fixes it, but if the file doesn't contain javascript, esprima fails and dumps a big stack trace. if that's not a problem, then simply changing the regex will do the trick :)
from workerify.
@dstokes the order is important when you specify your transforms. If you pass -t coffeeify -t workerify
instead of -t workerify -t coffeeify
your CoffeeScript will be compiled to JS before getting handled by workerify and it should work without any errors. That's the only workaround without changing Browserify at the moment :)
from workerify.
@hughsk yeah, I tested that. The file is properly transformed to js, but workerify checks the file (module) name's extension before parsing. Browserify does not change the string used in require statements (i.e. - 'thing.coffee') and thus, workerify skips it.
from workerify.
@dstokes Added coffee
to the extensions it accepts and using browserify test.coffee -t coffeeify -t workerify
works. Thanks for the suggestion!
from workerify.
@shama nice, thx!
from workerify.
Related Issues (12)
- Use falafel instead HOT 1
- Worker support on older webkit browsers HOT 1
- Use browserify's extensions option
- Unable to process workerified files with other browserify transforms HOT 2
- Generating a bundle with multiple entry points - Relative path to worker file breaking
- Using ancient browserify HOT 1
- workerify keyword no longer working HOT 1
- Workerify to separate files
- Inline functions
- SharedWorker support HOT 2
- workerify + browserify' s 'process' = window object undefined HOT 2
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 workerify.