Skip to content
This repository was archived by the owner on Oct 9, 2020. It is now read-only.
This repository was archived by the owner on Oct 9, 2020. It is now read-only.

Bundling a reusable library #383

@nukefusion

Description

@nukefusion

I'm having a real hard time understanding how to package a simple library that I can reuse with jspm. How do I bundle a reusable library whilst only exposing the modules I want, without module ID clashes?

I have an entry point file, index.js:

export { Class1 } from "./Classes/Class1";

When I build it I end up with:

System.register("Classes/Class2.js", [], function(exports_1) {
});

System.register("Classes/Class1.js", ["Classes/Class2.js"], function(exports_1) {
});

System.register("Index.js", ["Classes/Class1.js"], function(exports_1) {
});

It seems to me that anyone could require class2, even though it's just a dependency of class1 and not exposed via my entry point module. What I really want in terms of output is a single module that just exports Class1.

Also, how do I prefix these module paths with some sort of unique package ID? What if another 3rd party package defines Classes/Class1.js

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