I have written an es6 library that compiles to produce the following:
// All the library code, then...
export { default as Campaign } from './modules/campaign.js';
export { default as Triggers } from './modules/triggers.js';
export { default as Asset } from './modules/asset.js';
export { default as AssetSet } from './modules/assetSet.js';
I am then trying to import only Triggers from the library in another project
import { Triggers } from '../../my-library/lib/library.es.js';
When I inspect the bundle it contains all the code for every module exported from my library, rather than just the code from Triggers. I understood that treeshaking would allow me to import just the Triggers code. What am I doing wrong?
My library does not export a default, it only exports the named exports I have written above.
Edit - campaign.js
imports asset.js
so I would expect to get both when I import Campaign
, however Triggers
does not reference anything else.