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

How to combine lang trees from submodules #9

Closed
robbiemu opened this issue Jan 24, 2018 · 2 comments
Closed

How to combine lang trees from submodules #9

robbiemu opened this issue Jan 24, 2018 · 2 comments

Comments

@robbiemu
Copy link

I have a submodule with common ui elements, and my app-level projects pull this in. It deserves its own lang folder, rather than propagating the lang changes for those ui elements in all the apps that use the submodule. This brings to mind usage such as:

Lang.requireAll(require.context(['a', 'b', 'c'], true, '\.js$')

but require-context doesn't support that. I tried forking require-context to support an array of directories, but this produces the warning:

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

I'm not sure how to handle it really.

@valterlorran
Copy link
Owner

Hellow,
Did you try something like this?

Lang.requireAll(require.context('a', true, /\.js$/));
Lang.requireAll(require.context('b', true, /\.js$/));
Lang.requireAll(require.context('c', true, /\.js$/));

@robbiemu
Copy link
Author

Hi valterlorran -- no I hadn't! doh!

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

No branches or pull requests

2 participants