Skip to content

global cwise transform fails if regl is a dependency #12

Description

@rreusser

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 if regl is a dependency.

To reproduce:

$ echo "require('regl')" > index.js
$ npm i cwise
$ browserify -g cwise index.js

The resulting output is:

SyntaxError: Unexpected token (2:22) while parsing file: /Users/rreusser/test8/node_modules/regl/lib/constants/arraytypes.json
    at Parser.pp.raise (/Users/rreusser/test8/node_modules/cwise/node_modules/static-module/node_modules/falafel/node_modules/acorn/dist/acorn.js:1745:13)
    at Parser.pp.unexpected (/Users/rreusser/test8/node_modules/cwise/node_modules/static-module/node_modules/falafel/node_modules/acorn/dist/acorn.js:2264:8)
    at Parser.pp.semicolon (/Users/rreusser/test8/node_modules/cwise/node_modules/static-module/node_modules/falafel/node_modules/acorn/dist/acorn.js:2243:59)
    at Parser.pp.parseExpressionStatement (/Users/rreusser/test8/node_modules/cwise/node_modules/static-module/node_modules/falafel/node_modules/acorn/dist/acorn.js:2677:8)
    at Parser.pp.parseStatement (/Users/rreusser/test8/node_modules/cwise/node_modules/static-module/node_modules/falafel/node_modules/acorn/dist/acorn.js:2462:160)
    at Parser.pp.parseBlock (/Users/rreusser/test8/node_modules/cwise/node_modules/static-module/node_modules/falafel/node_modules/acorn/dist/acorn.js:2692:21)
    at Parser.pp.parseStatement (/Users/rreusser/test8/node_modules/cwise/node_modules/static-module/node_modules/falafel/node_modules/acorn/dist/acorn.js:2443:19)
    at Parser.pp.parseTopLevel (/Users/rreusser/test8/node_modules/cwise/node_modules/static-module/node_modules/falafel/node_modules/acorn/dist/acorn.js:2379:21)
    at parse (/Users/rreusser/test8/node_modules/cwise/node_modules/static-module/node_modules/falafel/node_modules/acorn/dist/acorn.js:101:12)
    at module.exports (/Users/rreusser/test8/node_modules/cwise/node_modules/static-module/node_modules/falafel/index.js:22:15)

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?).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions