Browserify Support
See original GitHub issueI’m trying to figure out how to bundle the browser version when requiring and bundling asap
from another module. It seems that simply require("asap")
bundles the node version in the browserify bundle.
I might be missing something trivial, if so, please let me know.
Edit:
It also works if I modify package.json
in asap to qualify the browser*js
files in the browser
section. This seems to be the better option as it requires no change to the package.json
in the requiring module.
"main": "./asap.js",
"browser": {
"./asap.js": "./browser-asap.js",
"./raw.js": "./browser-raw.js",
"test/domain": "./test/browser-domain.js"
},
/Edit
It does seem to work if I do the following in package.json in my module that requires asap
:
"browser": {
"asap": "asap/browser-asap"
}
and also manually modifying browser-asap.js
in the asap
module to require browser-raw
var var rawAsap = require("./browser-raw");
Thanks.
Issue Analytics
- State:
- Created 9 years ago
- Comments:15 (10 by maintainers)
Top Results From Across the Web
Browserify
Browserify lets you require('modules') in the browser by bundling up all of your dependencies. Install Documentation · Source Code · Help + Articles...
Read more >browserify/browserify: browser-side require() the node.js way
Use a node-style require() to organize your browser code and load modules installed by npm. browserify will recursively analyze all the require() calls...
Read more >Lesson 3. Bundling modules with Browserify
How does Browserify help with ES6 modules? You learned in lesson 2 that Babel transpiles your ESNext code so you can execute it...
Read more >Browserify Tutorial - Using require() In The Browser - YouTube
... modules in the front-end part of your web application (in the browser) with the help of a very powerful tool called Browserify....
Read more >Getting Started with Browserify - SitePoint
Browserify allows us to use node.js style modules in the browser. We define dependencies and then Browserify bundles it all up into a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m attempting to use https://github.com/Khan/aphrodite in a project that I’m building with https://github.com/fuse-box/fuse-box
The
browser
mapping doesn’t seem to work withfuse-box
(it works for the entry point, but not the other internal modules, such asraw
).The only way I can make this work is by changing:
to
in
browser-asap.js
.@ewie I mean 2.0.2, which I forgot to push. Fixed.