question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: How do I specifically turn on browserField for particular requires?

See original GitHub issue

I am programatically generating a bundle:

var browserify = require('browserify'),
    bundle = browserify({
        insertGlobalVars: false,
        detectGlobals: true,
        browserField: false,
        bare: true,
        builtins: false,
        commondir: true
    });

bundle.require('crypto-browserify', {
    expose: 'crypto',
    browserField: true // THIS IS WHAT I WANT TO DO
});

In the above code, I want to bundle all code with browserField turned off, but only turn it on for the particular crypto-browserify require. How do I do it? I may have missed something in documentation, but please excuse me for that.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

1reaction
shamasiscommented, Jan 28, 2017

I had given myself a full week to see if anyone from community can show me a direction before I deep dive.

My plan otherwise is to write a transformer that takes in package names and when those requires are encountered, return the browser-require result instead of original.

0reactions
shamasiscommented, Feb 24, 2019

Yep. I’ve accommodated basics in github.com/postmanlabs/postman-sandbox but didn’t get time to extract it out as an independent module

Read more comments on GitHub >

github_iconTop Results From Across the Web

Force users to sign in to Chrome Browser (user policies only)
Click Settings​​ Go to Sign-in settings. For Browser sign-in settings, select Force users to sign-in to use the browser. Click Save.
Read more >
How to turn off form autocompletion - Web security | MDN
This article explains how a website can disable autocomplete for form fields.
Read more >
What happens when you type a URL into your browser? - AWS
2. Browser looks up IP address for the domain. After you've typed the URL into your browser and pressed enter, the browser needs...
Read more >
Easy Checks – A First Review of Web Accessibility - W3C
Tab to all: Check that you can tab to all the elements, including links, form fields, buttons, and media player controls. (A common...
Read more >
Chrome Browser Privacy Policy - Google
Here's everything you need to know about your privacy while ... Details specific to Chrome are provided in this Notice where relevant.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found