-
Notifications
You must be signed in to change notification settings - Fork 36
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
Ability to skip first directories #15
Comments
Eek. I've faced a similar problem in the past - in the gobble plugin that wraps browserify, I had to explicitly make the paths absolute otherwise I'd end up in the same situation. It seems that this is something that should probably be fixed within browserify. It doesn't have a concept of a 'destination' for the file, since it just creates a stream, but perhaps it should have a Incidentally you shouldn't need to use exorcist if you're using sorcery - sorcery will read the inline data URI just as happily as the separate .map file exorcist generates. |
@zba FYI there was some discussion the browserify issue tracker, and a second issue has been raised - browserify/browserify#1304. Unfortunately I'm not sure that this is best solved within sorcery in the meantime, since it only addresses the first sourcemaps encountered - any transpilation step could have similar problems, and I don't think there's a particularly good way to address them via configuration options. I think the best interim solution would be to modify the sourcemap between browserify and sorcery. mold-source-map might be useful here - I haven't used it, but I think it's suitable for this sort of task. Alternatively... var json = fs.readFileSync('bundle.js.map', 'utf-8');
var map = JSON.parse(json);
map.sourceRoot = '../';
json = JSON.stringify(map);
fs.writeFileSync('bundle.js.map', json); |
I have the following compile flow:
babel->browserify->exorciise->sorcery
so I would to apply magic to browserify sourcemaps , but since browserify has no cwd option, it will generate paths relative to project root, so, if generated .js file not in project root path sorcery will not find original map... one possible workaround is symlink, but it would be better to have option like in 'patch' --strip=num (-pnum)
example project tree:
The text was updated successfully, but these errors were encountered: