Giter Club home page Giter Club logo

browserify-breakdown's People

Contributors

seangenabe avatar stefanmaric avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

browserify-breakdown's Issues

Massive memory usage

I'm attempting to examine a bundle of 79mb but I keep getting JavaScript heap out of memory. I gave it 16gb of memory to work with but it wasn't enough. Is this normal or is something else going on?

Error with circular deps: level is not defined

browserify-breakdown < _dist/js/index.min.js 
project/node_modules/browserify-breakdown/index.js:44
          level: level,
                 ^

ReferenceError: level is not defined
    at walk (project/node_modules/browserify-breakdown/index.js:44:18)
    at project/node_modules/browserify-breakdown/index.js:63:14
    at Array.map (native)
    at walk (project/node_modules/browserify-breakdown/index.js:62:28)
    at project/node_modules/browserify-breakdown/index.js:63:14
    at Array.map (native)
    at walk (project/node_modules/browserify-breakdown/index.js:62:28)
    at project/node_modules/browserify-breakdown/index.js:63:14
    at Array.map (native)
    at walk (project/node_modules/browserify-breakdown/index.js:62:28)

Using:

[email protected]
[email protected]
[email protected]

Mac support: Use unix line endings

$ npm install -g browserify-breakdown
$ browserify-breakdown
env: node\r: No such file or directory

If you convert the line endings to unix style, then this will start working for users on non-Windows systems, I believe. If you google for the error message, you can see how others resolved it. For example: nwutils/nw-builder#75

Example of programmatic use?

Unfortunately for me, on a Windows environment running:

Get-Content .\_Inc\0.common-factor.js | browserify-breakdown

Always throws an error:

SyntaxError: Error parsing regular expression: Invalid regular expression: /^-???[\d,]+.?\d*$/: Nothing to repeat (17153:11)
at Parser.pp$4.raise (C:\Users\mike.dvorscak\AppData\Roaming\npm\node_modules\browserify-breakdown\node_modules\acorn\dist\acorn.js:2488:13)
at tryCreateRegexp (C:\Users\mike.dvorscak\AppData\Roaming\npm\node_modules\browserify-breakdown\node_modules\acorn\dist\acorn.js:3029:44)
at Parser.pp$7.readRegexp (C:\Users\mike.dvorscak\AppData\Roaming\npm\node_modules\browserify-breakdown\node_modules\acorn\dist\acorn.js:3090:5)
at Parser.pp$7.readToken_slash (C:\Users\mike.dvorscak\AppData\Roaming\npm\node_modules\browserify-breakdown\node_modules\acorn\dist\acorn.js:2862:50)
at Parser.pp$7.getTokenFromCode (C:\Users\mike.dvorscak\AppData\Roaming\npm\node_modules\browserify-breakdown\node_modules\acorn\dist\acorn.js:2988:17)
at Parser.pp$7.readToken (C:\Users\mike.dvorscak\AppData\Roaming\npm\node_modules\browserify-breakdown\node_modules\acorn\dist\acorn.js:2733:15)
at Parser.pp$7.nextToken (C:\Users\mike.dvorscak\AppData\Roaming\npm\node_modules\browserify-breakdown\node_modules\acorn\dist\acorn.js:2724:13)
at Parser.pp$7.next (C:\Users\mike.dvorscak\AppData\Roaming\npm\node_modules\browserify-breakdown\node_modules\acorn\dist\acorn.js:2684:8)
at Parser.pp.eat (C:\Users\mike.dvorscak\AppData\Roaming\npm\node_modules\browserify-breakdown\node_modules\acorn\dist\acorn.js:555:10)
at Parser.pp$3.parsePropertyValue (C:\Users\mike.dvorscak\AppData\Roaming\npm\node_modules\browserify-breakdown\node_modules\acorn\dist\acorn.js:2208:12)

I suspect that this is not a problem with acorn, but rather the encoding of the file when windows pipes it's contents to this script.

I might be able to avoid this whole thing by adding a gulp task to do this for me. I looked in the tests and it seems this library works with strings. Will it also work for streams? Maybe you could add some programmatic examples in the README (using gulp, using scripts).

info[moduleId] is undefined

$ npx browserify-breakdown < build/assets/discovery-0.1.0.js
npx: installed 40 in 8.712s
/npm5-cache/_npx/8/lib/node_modules/browserify-breakdown/index.js:52
      size: Buffer.byteLength(info[moduleId].source)
                                            ^

TypeError: Cannot read property 'source' of undefined
    at walk (/npm5-cache/_npx/8/lib/node_modules/browserify-breakdown/index.js:52:45)
    at /npm5-cache/_npx/8/lib/node_modules/browserify-breakdown/index.js:59:14
    at Array.map (native)
    at walk (/npm5-cache/_npx/8/lib/node_modules/browserify-breakdown/index.js:58:28)
    at /npm5-cache/_npx/8/lib/node_modules/browserify-breakdown/index.js:59:14
    at Array.map (native)
    at walk (/npm5-cache/_npx/8/lib/node_modules/browserify-breakdown/index.js:58:28)
    at /npm5-cache/_npx/8/lib/node_modules/browserify-breakdown/index.js:59:14
    at Array.map (native)
    at walk (/npm5-cache/_npx/8/lib/node_modules/browserify-breakdown/index.js:58:28)

it does work on the vendor.js from the same project, though, which is built using a similar browserify configuration.

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.