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
{{ message }}
Repository navigation
Support CommonJS modules & npm packages in ts_devserver & ts_web_test_suite #646
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.
#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.
Activity
[-]Support CommonJS npm packages in ts_devserver & ts_web_test_suite[/-][+]Support CommonJS modules & npm packages in ts_devserver & ts_web_test_suite[/+]gregmagolan commentedon May 9, 2019
#725 partially solves this as it provides a browserify generated
@npm//node_modules/foobar:foobar.umd.jsand@npm//node_modules/@foo/bar:bar.umd.jstargets 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 commentedon May 9, 2019
Closing with #725