Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browserify with paths to folders in my system #675

Closed
vinz243 opened this issue Feb 25, 2014 · 8 comments
Closed

Browserify with paths to folders in my system #675

vinz243 opened this issue Feb 25, 2014 · 8 comments

Comments

@vinz243
Copy link

vinz243 commented Feb 25, 2014

When I compile markdown-symbols using Broserify (browserify file.js -o bundle.js), I get something like that :

!function(e){if("object"==typeof exports...[function(_dereq_,module,exports){

},{}],2:[function(_dereq_,module,exports){
...
...
[on line 8000] 
    : function (str, start, len) {
        if (start < 0) start = str.length + start;
        return str.substr(start, len);
    }
;

}).call(this,_dereq_("C:\\Users\\Me\\AppData\\Roaming\\npm\\node_modules\\browserify\\node_modules\\insert-module-globals\\node_modules\\process\\browser.js"))
},{"C:\\Users\\Me\\AppData\\Roaming\\npm\\node_modules\\browserify\\node_modules\\insert-module-globals\\node_modules\\process\\browser.js":11}],14:[function(_dereq_,module,exports){
module.exports=_dereq_(3)
},{}],15:[function(_dereq_,module,exports){
module.exports=_dereq_(4)
},{"./support/isBuffer":14,"C:\\Users\\ME\\AppData\\Roaming\\npm\\node_modules\\browserify\\node_modules\\insert-module-globals\\node_modules\\process\\browser.js":11,"inherits":10}],16:[function(_dereq_,module,exports){
var frep = _dereq_('frep');
var file = _dereq_('fs-utils');
var delims = _dereq_('delims');
var _ = _dereq_('lodash');
...

As you can see, there are absolute paths to my files here. Why ? How can I remove them ?

@guybrush
Copy link
Contributor

guybrush commented Mar 1, 2014

you might want to take a look at https://github.com/substack/intreq

$ npm i -g browserify browser-unpack browser-pack intreq
$ browserify file.js | browser-unpack | intreq | browser-pack > bundle.js

@vinz243
Copy link
Author

vinz243 commented Mar 1, 2014

I got this error:

λ browserify index.js | browser-unpack | intreq | browser-pack > bundle2.js                                                   

C:\Users\Me\AppData\Roaming\npm\node_modules\browser-unpack\index.js:33                                               
            start = body.range[0];                                                                                            
                              ^                                                                                               
TypeError: Cannot read property '0' of undefined                                                                              
    at C:\Users\Choupignon\AppData\Roaming\npm\node_modules\browser-unpack\index.js:33:31                                     
    at Array.map (native)                                                                                                     
    at module.exports (C:\Users\Choupignon\AppData\Roaming\npm\node_modules\browser-unpack\index.js:29:18)                    
    at ConcatStream.cb (C:\Users\Choupignon\AppData\Roaming\npm\node_modules\browser-unpack\bin\cmd.js:16:16)                 
    at ConcatStream.end (C:\Users\Choupignon\AppData\Roaming\npm\node_modules\browser-unpack\node_modules\concat-stream\index.
js:45:21)                                                                                                                     
    at Socket.onend (_stream_readable.js:483:10)                                                                              
    at Socket.g (events.js:180:16)                                                                                            
    at Socket.EventEmitter.emit (events.js:117:20)                                                                            
    at _stream_readable.js:920:16                                                                                             
    at process._tickCallback (node.js:415:13)                                                                                 

@hughsk
Copy link
Member

hughsk commented Mar 1, 2014

@vinz243 make sure you're not requiring an empty module anywhere in your bundle. I submitted a fix for the problem a short while ago: browserify/browser-unpack#1

@vinz243
Copy link
Author

vinz243 commented Mar 3, 2014

how to know which module is empty ? any argument ? I have updated browser-unpack to 0.1.0 but it didn't solve anything.

@guybrush
Copy link
Contributor

guybrush commented Mar 3, 2014

hm actually i dont know if pipes are even a thing in windows-shell?

@thlorenz
Copy link
Collaborator

thlorenz commented Mar 3, 2014

@guybrush they are in powershell, but work entirely different (i.e. on objects instead of strings).

@ghost
Copy link

ghost commented May 10, 2014

fixed in 3.46.1

@py-in-the-sky
Copy link

You can now use https://www.npmjs.com/package/bundle-collapser

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants