Confused about opts.fullPaths · Issue #902 · browserify/browserify · GitHub
Skip to content

Confused about opts.fullPaths #902

Open

Description

@callumlocke

from the readme:

opts.fullPaths disables converting module ids into numerical indexes. This is useful for preserving the original paths that a bundle was generated with.

afaict it always does this anyway - is this a bug?

I really want to remove the system paths. Explicitly setting this to false doesn't help. Is there any way?

Activity

  1. maxlath commented on Nov 4, 2014

    @maxlath

    opts.fullPaths only toggles the alternative between having:

    // fullPaths=true
    // [...]
    },{}],"/path/to/modules/":[function(require,module,exports){
    // [...]

    or

    // fullPaths=false
    // [...]
    },{}],33:[function(require,module,exports){
    // [...]
    // and then at the end of the file, the index to
    // to find the full path back
    {"./lib/_stream_duplex.js":33,"./lib/_stream_passthrough.js":58,"./lib/_stream_readable.js":59,"./lib/_stream_transform.js":60,"./lib/_stream_writable.js":61,"/mysystem/myproject/node_modules/browserify/node_modules/readable-stream/readable.js":18,"stream":21}]
    // [...]

    I think your problem is rather similar to this issue #675

  2. py-in-the-sky commented on May 29, 2015

    @py-in-the-sky
  3. jmm commented on May 29, 2015

    @jmm
    Collaborator

    @callumlocke What exactly are you trying to accomplish: keep absolute paths out of the bundle? Keep any path data (even relative) out? Please create a repo with a simple reproduction and explanation of how the actual output differs from your desired output.

  4. callumlocke commented on Jul 2, 2015

    @callumlocke
    Author

    @jmm I don't want any paths in the bundle.

    The issue is the statement I quoted from the readme seems to be wrong: it suggests that paths are usually converted into numerical indexes (unless you explicitly enable opts.fullPaths). But in my experience this isn't true, you always get string paths.

  5. jmm commented on Jul 2, 2015

    @jmm
    Collaborator

    @callumlocke Ok, thanks for elaborating, I see what you mean. It must have worked that way at one point, but like you said it's obviously inaccurate now. My understanding is that, pretty much what @maxlath said, fullPaths currently toggles absolute local paths instead of relative paths (to the require()'ing file or base dir).

    In any case, as @py-in-the-sky said I think the solution to your problem is bundle-collapser. Can you please take a look and post back here whether that does the trick for you?

    I'm putting a documentation label on this issue to get that description straightened out.

    Thanks!

  6. added a commit that references this issue on May 18, 2018
    03f0004
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions