-
Notifications
You must be signed in to change notification settings - Fork 96
jsnext:browser? #60
Comments
@nolanlawson how's that resolved by the different bundlers (inc. Browserify, Rollup, Webpack) if I just require the module name? I guess we have to reference the path explicitly? Use case for jsnext:browser: I would like to have two versions of the my library for the browser as well, where the "next" version uses ES modules and does not polyfill the Fetch API, while the normal transpiles and polyfills. And I'd like users of those bundlers to be able to use the "next" version for the browser if they're not targeting older browsers. |
Oh, does it resolve the Edit:
|
@joaovieira you can do that as described by @nolanlawson The "main": "withfetch.js",
"module": "withfetch.esm.js",
"browser": {
"withfetch.js": "withfetch.browser.js",
"withfetch.esm.js": "withoutfetch.browser.esm.js"
} |
@bfred-it thanks, that guided me to it - browser paths are relative. I got it working with: "main": "dist/lib.polyfill.js",
"module": "dist/lib.es6.polyfill.js",
"browser": {
"./dist/lib.es6.polyfill.js": "./dist/lib.es6.js"
} |
I have a package that targets Node and the browser but not isomorphically—I have a Node-specific script and a browser-specific script. I wish to bundle each of these in CJS and ES6 formats. How may I do this? Seems like
jsnext:browser
is required:The text was updated successfully, but these errors were encountered: