Skip to content

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

Closed

Description

@gregmagolan

🚀 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.

Activity

  1. self-assigned this
    on Apr 2, 2019
  2. 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[/+] on Apr 2, 2019
  3. gregmagolan commented on May 9, 2019

    @gregmagolan
    CollaboratorAuthor

    #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.

  4. gregmagolan commented on May 9, 2019

    @gregmagolan
    CollaboratorAuthor

    Closing with #725

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions