With Node.js now supporting ES modules Bacon should be imported in the same fashion on both platforms the browser and Node.js. This allows to use Bacon in "isomorphic" (i.e. running on Node.js and the browser) source files.
The aim is to support import * as Bacon from 'baconjs' regardless if running in Node.js or the browser.
Using relative path import specifiers it is already possible to target dist/Bacon.mjs but that approach is not so flexible as using bare import specifiers.
Currently:
Node.js
// using bare specifiers
require('baconjs') ---------┐
├-> package.json["main"] -> dist/Bacon.js (ES5)
import Bacon from 'baconjs' -┘
With Node.js now supporting ES modules Bacon should be imported in the same fashion on both platforms the browser and Node.js. This allows to use Bacon in "isomorphic" (i.e. running on Node.js and the browser) source files.
The aim is to support
import * as Bacon from 'baconjs'
regardless if running in Node.js or the browser.Using relative path import specifiers it is already possible to target
dist/Bacon.mjs
but that approach is not so flexible as using bare import specifiers.Currently:
Node.js
ES6 Browser (all, except IE)
Proposed change to
package.json
ES6 browsers and Node.js
If agreeable I'd assemble a small PR with a smoke test?