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

Support CommonJS modules & npm packages in ts_devserver & ts_web_test_suite #646

Closed
gregmagolan opened this issue Apr 2, 2019 · 2 comments
Assignees

Comments

@gregmagolan
Copy link
Collaborator

🚀 feature request

Relevant Rules

ts_devserver, ts_web_test, ts_web_test_suite, karma_web_test, karma_web_test_suite

Description

Right now to use commonjs modules or npm packages in ts_devserver (and other rules) you need to transform the modules to named UMD or named AMD manually using a tool such as browserify. An example of this transform is: angular/angular-bazel-example#343.

Describe the solution you'd like

A general solution is needed so that if ts_devserver has a direct or transitive dependency on an npm package such as @npm//date-fns it will just work without any extra work required by the user. This solution should also handle deep imports such as import * as factory from 'date-fns/factory' where possible.

@gregmagolan gregmagolan self-assigned this Apr 2, 2019
@gregmagolan gregmagolan changed the title Support CommonJS npm packages in ts_devserver & ts_web_test_suite Support CommonJS modules & npm packages in ts_devserver & ts_web_test_suite Apr 2, 2019
@gregmagolan
Copy link
Collaborator Author

#725 partially solves this as it provides a browserify generated @npm//node_modules/foobar:foobar.umd.js and @npm//node_modules/@foo/bar:bar.umd.js targets for use in ts_devserver and other rules. Propagation of these targets to these rules is not automatic yet as browserify on the "main" will likely not work for all npm packages.

@gregmagolan
Copy link
Collaborator Author

Closing with #725

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