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

Feature request to access source file name #278

Closed
shibukawa opened this issue Oct 7, 2013 · 2 comments
Closed

Feature request to access source file name #278

shibukawa opened this issue Oct 7, 2013 · 2 comments

Comments

@shibukawa
Copy link
Contributor

I can access to module information by using JSX.require() function from JS code, but there is no way to get primary source file name (it was passed to JSX compiler).

If I can get primary source file name, I can write custom bootstrap code easily.

For example, just import following code, you can export all export classes and use as standard CommonJS code.

native class CommonJSExporter {
} = '''
var module = JSX.require(JSX.getPrimarySourceFile());
for (var key in module)
{
    if (key.match(/^[a-zA-Z0-9]+$/))
    {
        exports[key] = module[key];
    }
}
'''
@shibukawa
Copy link
Contributor Author

It can support all styles of entry points. #259 is not needed anymore.

@shibukawa
Copy link
Contributor Author

I made a tool that parses resulting JavaScript code and get module information. This is not needed anymore for me.

https://github.com/shibukawa/jsx-linker

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

No branches or pull requests

1 participant