-
Notifications
You must be signed in to change notification settings - Fork 27
Fix es6 build and add Steal compatibility. #13
Conversation
Those are good fixes although you could just map I'm still not happy how Steal doesn't ship with the Node built-ins by default (I think that is what https://github.com/stealjs/node-browser-builtins is supposed to be for). Everything else in this PR is fine but it would be nice to get rid of the |
Yeah. It doesn't seem very intuitive to have to install modules that are pre-packaged with Node. Isn't there an EngineDependencies or something like that for Steal? Could the browser be one of those engines to have it install those specific dependencies for Steal? |
I would take the dependencies out here and try it with https://github.com/stealjs/node-browser-builtins or mapping to |
6d0a6de
to
aea04ea
Compare
Ok. All good points. Take a look, now. The import feathers from 'feathers-client/dist/feathers'; |
@daffl You mind if I merge and release this? |
I had issues with the it('is CommonJS compatible', () => {
assert.equal(typeof require('../lib'), 'function');
}); And changed the "test": "npm run compile && npm run jshint && npm run mocha" |
aea04ea
to
9401add
Compare
|
||
it('is CommonJS compatible', () => { | ||
console.log(require('../lib/client')); | ||
assert.equal(typeof require('../lib/client'), 'function'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably needs to be 'object' ;)
9401add
to
10663c2
Compare
@daffl
I've fixed the exports on src/sockets/index.js so that the Babel build does not strip socketio and primus from the final export. This line in
client.js
was getting compiled to
But
_index4.default
wasundefined
. Modifying the exports fixed the issue.I've also added the
events
andquerystring
core node modules to the dependencies, so they get included with the build. This lets Steal use the main package instead of thedist/feathers.js
file.Finally, I've added /index to a couple of imports because Steal was looking for a file called ./rest.js instead of ./rest/index. The same goes for ./sockets.
Closes #12 .