-
Notifications
You must be signed in to change notification settings - Fork 7
Fast-Browserify does not pick up some files? (perhaps symlinks?) #15
Comments
I have this hunch mainly, because fast-browserify tries to find |
It's not the symlink. I modified all instances of symlink-or-copy to just copy and the behaviour is still the same. Browserify itself gets intsanciated with the right path ( |
Thanks for the detailed report. I will check it out when I get a chance. |
i'll keep you posted with the debug progress in here. Maybe i'll figure it out. Or i'll find a workaround along the way :D |
The very same thing happens, when i convert to ES6 imports and run my app.js bundle through |
it works just fine with "regular" JS Files that are in /app anyway. But the "here's a JSX, and now it's a JS" move appears to be confusing something. I'll stop debugging for now. |
@ccoenen, I have the same issue. Starting with this specific commit browserify/browserify@504832b, browserify resolve symlinks. Broccoli after a transformation create a new temporal folder with symlinks to unchanged files, in your case So browserify resolve The first work around, is to set browserify version in this plugin to I don't know if the new behavior in browserify is a bug. |
Here another simple example of the problem, Consider 2 files: console.log('hello');
require('./transformed/a.js') The idea is with some broccoli plugin transform the file in
var mergeTrees = require('broccoli-merge-trees');
var fastBrowserify = require('broccoli-fast-browserify');
var funnel = require('broccoli-funnel');
// the folder public/need_transform is tranformed using some plugin,
// in this example, I just rename the folder
var transformed = funnel('public', {srcDir: 'need_transform', destDir: 'transformed'});
// the transformed folder is merged with the original folder. Broccoli will create
// a new temporal folder with symbolic links to the original files
var scripts = mergeTrees(['public', transformed]);
// the compilation with browserify 10.2.5+ fails. The reason is that the symbolic link of
// index.js is resolved to public/index.js, then the relative path inside require folder is resolved
// to public/transformed/a.js which does no exists
var compiled = fastBrowserify(scripts, {
bundles: {
'app.js': {
entryPoints: 'index.js'
}
}
});
module.exports = compiled; |
I wish I had time to debug this, but I'm in a crunch period at work now. It may be a couple weeks before I can track this down, sorry! If you find anything submit a PR and I can make a new release :) |
Thanks to @jfgodoy for finding the problem. I've published a new version of I'm busy for a couple weeks, but I can take a look at then if there isn't a PR that fixes it :) Thanks for all the debugging! |
I can confirm that it's no longer an issue with 0.2.8. Would you like to keep this open for a more permanent fix? Big thanks to @jfgodoy for your support, too! |
Yeah, I was planning on leaving this open. I should add something to the README as well. |
👍 Any update on this? This is by far the best of the Broccoli + Browserify integrations. |
I might have time to look into this on Tuesday. |
https://github.com/eploko/broccoli-watchify 1.0.0 now addresses this issue via eploko/broccoli-watchify@f8debb5 |
I made a repository with exactly three commits, you can clone it here:
https://github.com/ccoenen/broccoli-fast-browserify-issue-next
On Linux, this happens:
In this commit, i'm not yet using fast-browserify (do not be fooled, it's already in the
Brocfile.js
, but i'm skipping it!). ccoenen/broccoli-fast-browserify-issue-next@6e9b8ccWhen run
broccoli build production
, it works, and the output is as expected (app.js, react-component.js and react-component.jsx).In the following commit, i'm adding fast Browserify into the mix: ccoenen/broccoli-fast-browserify-issue-next@171ccef
Fast-Browserify will fail with this issue:
If i do not try to require it, it will work again and everything else will be good. This can be seen in the third commit at ccoenen/broccoli-fast-browserify-issue-next@b639c5c
I do not have this issue on windows. On windows, all three commits work! I have the hunch that fast-browserify does not pick up on symlinks. The previous thing in the brocfile uses caching-writer, and that seems to symlink unchanged files.
The text was updated successfully, but these errors were encountered: