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

Added support for absolute paths in annotations. You can also pass a fun... #8

Merged
merged 1 commit into from
Mar 27, 2015

Conversation

doronin
Copy link

@doronin doronin commented Mar 24, 2015

Added support for absolute paths in annotations. You can also pass a function in options.preprocessor to modify the contents of file before it is searched for dependencies. preprocessor is needed for existing project that I'm working on which has relative paths that are dot-separated. Using preprocessor I can transform paths like com.example.ClassName into com/example/ClassName.js

@backflip
Copy link
Owner

Hey Alexey

It is definitely reasonable to be able to transform a path. However, I'd prefer to have an option resolvePath which would default to function(match) { return path.join(path.dirname(targetFile.path), match); }. This would allow you to handle both absolute paths and completely arbitrary strings.

What do you think?

@doronin
Copy link
Author

doronin commented Mar 26, 2015

I like the idea of having resolvePath instead of preprocessor. It makes API cleaner. I'll refactoring my code

…function in `options.preprocessor` to modify the contents of file before it is searched for dependencies.
@doronin
Copy link
Author

doronin commented Mar 26, 2015

Updated commit

backflip added a commit that referenced this pull request Mar 27, 2015
@backflip backflip merged commit 84863e1 into backflip:master Mar 27, 2015
@backflip
Copy link
Owner

Thanks a lot! Released in 2.1.0

@doronin
Copy link
Author

doronin commented Mar 27, 2015

Thanks Thomas!

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

Successfully merging this pull request may close these issues.

2 participants