calvinmetcalf / rollup-plugin-node-builtins

138 stars 40 forks source link

Stuck with some globals (advice needed) #30

Open binarykitchen opened 7 years ago

binarykitchen commented 7 years ago

This is rather a request for advice rather than a bug report. In this experimental, incomplete branch I have this rollup config: https://github.com/binarykitchen/videomail-client/blob/feature/rollupjs/env/dev/rollup.config.js

which complains with some errors related to global and/or built in stuff. with code elimination i figured out it must be somehow related to your plugin. here a whole output

~/c/videomail-client ❯❯❯ yarn build:dev                                                                                                                                                                       ⏎ feature/rollupjs ✭ ✱
yarn build:dev v0.24.5
$ npm run std --silent
$ rollup -c env/dev/rollup.config.js -w 
bundling...
92% (700): src/wrappers/optionsWrapper.js⚠️   'default' is not exported by 'node_modules/global/window.js'
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
commonjs-proxy:/home/michael-heuberger/code/videomail-client/node_modules/global/window.js (1:137)
1: import * as window from "/home/michael-heuberger/code/videomail-client/node_modules/global/window.js"; export default ( window && window['default'] ) || window;
                                                                                                                                            ^

⚠️   'default' is not exported by 'node_modules/global/document.js'
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
commonjs-proxy:/home/michael-heuberger/code/videomail-client/node_modules/global/document.js (1:145)
1: import * as document from "/home/michael-heuberger/code/videomail-client/node_modules/global/document.js"; export default ( document && document['default'] ) || document;
                                                                                                                                                    ^

🚨   'default' is not exported by node_modules/websocket-stream/stream.js
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
src/wrappers/visuals/recorder.js (3:7)
1: import { Buffer } from "/home/michael-heuberger/code/videomail-client/node_modules/buffer-es6/index.js";
2: 
3: import websocket from 'websocket-stream';
          ^
4: import Frame from 'canvas-to-buffer';
5: import util from 'util';

Done in 9.92s.

is there anything suspicious you can see? do you recommend any config changes?

thanks heaps - i am stuck here ...

alwaysonlinetxm commented 7 years ago

Same problem when I use react with global and built plugins.

colwilson commented 7 years ago

Same issue when I try to use aws-sdk (which has buffer as a dependency)

🚨 'isBuffer' is not exported by node_modules/buffer/index.js https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module node_modules/rollup-plugin-node-builtins/src/es6/http-lib/to-arraybuffer.js (5:8)

calvinmetcalf commented 7 years ago

@colwilson aws-sdk is not going to work because it relies on the crypto module which I haven't ported to this module yet

chmaltsp commented 5 years ago

Any update on this, this is a serious blocker when working with pusher-js