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 }}
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.
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?
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
The text was updated successfully, but these errors were encountered:
Thanks Guy, I think I must be misunderstanding something. That does give me a single module and desirably encapsulates my private modules, however it also adds 450-odd lines of module resolution logic in an IIFE at the start of the output which seems superfluous for my needs as I will be using jspm/systemjs to import this module into other projects anyway.
If I create many reusable libraries in this way wouldn't that same logic get injected at the start of each library? If I'm using systemjs to import all of these libraries into another project doesn't this approach mean an awful lot of bloat?
@nukefusion yes there is some boilerplate, which is necessary to handle the interaction between CommonJS and ES6 circular references. The focus here is then on specific optimizations say if the whole tree is ES6 then we want to use rollup, as in #205.
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:
When I build it I end up with:
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 exportsClass1
.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
The text was updated successfully, but these errors were encountered: