You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
#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.
🚀 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 asimport * as factory from 'date-fns/factory'
where possible.The text was updated successfully, but these errors were encountered: