-
Notifications
You must be signed in to change notification settings - Fork 12
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
global cwise transform fails if regl is a dependency #12
Comments
It could be due to ES6 syntax. Switching the cwise transform to babel might fix it. |
Can you clarify what you mean? Do you mean to babelify first, then apply the cwise transform? $ browserify -g [ babelify --presets [ es2015 ] ] -g cwise index.js > bundle.js |
That might work, but a better solution would be to fix the cwise transform falafel dependency to use es6 instead. |
I updated cwise's static-module dep to see if I'd get lucky, but that didn't fix it. I verified that the newer version indeed sends The cause seems to be that acorn is parsing the json requires as javascript. See: acornjs/acorn#415 So in that sense, it's correct to fail, but the question then is which step in the chain is failing such that it's trying to parse json as javascript. The one simple fix that did work was to change regl's constants to |
For reference, a repo that reproduces this using cwise with an updated static-module dependency: https://github.com/rreusser/cwise-regl-interaction To reproduce: git clone https://github.com/rreusser/cwise-regl-interaction.git
cd cwise-regl-interaction
npm install
npm run bundle Didn't otherwise manage to make headway though. 😞 |
Not sure if anyone's still working on a solution, but I hacked together a fix for the project I'm currently working on. Unfortunately I couldn't get the latest version of Editing to clarify: my use case doesn't involve |
A weird interaction, but figured I'd ask since it lives in the same ecosystem. A global cwise transform is useful since most cwise-based modules are not cwise-transformed. However,
browserify -g cwise
fails ifregl
is a dependency.To reproduce:
The resulting output is:
It's just a small json file, so it's not immediately apparent what there is to dislike about it. I'm wondering if perhaps it's just uglify-js that needs a 2.6 -> 2.7 update or something of the sort (acorn maybe?).
The text was updated successfully, but these errors were encountered: