Skip to content

[Proposal] Publish /lib/js/* as an npm package #2127

@jchavarri

Description

@jchavarri

The seems to be no way at the moment to use BuckleScript generated JS code in apps or libraries without forcing consumers to include bs-platformin their dependencies, or authors to bundle their code.

A real world case can be found in VS Code extensions (node.js apps). Publishing a VS Code extension with bs-platform in package.json would mean hundreds of MBs are sent to Microsoft publishing servers. Actually, any regular node.js app will have a similar problem when being deployed.

I'm pretty sure this has been discussed before, but I'm interested in the minimum work required to make this happen:

  • Use lerna or a custom script to automate this new package publishing
  • Add an option in bsconfig.json package-specs so the output JS requires from this new package optionally. Or alternatively, make the separate package the only option.
  • Change the compiler so the new package name is used on each module that depends on /lib/js

Happy to help with this.

Related:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions