a function that is called when the bundle of your package has been fetched by the browser. It allows to proceed to additional installation/initialization steps before the modules get instantiated.
asset id in the YouWol's assets store
description of the FluxPack, the package.json description if AUTO_GENERATED fields are used
This attributes stores the module's factory, it is populated when the decorator '@Flux' is run by the compiler
name of the fluxPack, the package.json name if AUTO_GENERATED fields are used
the YouWol's CDN url targeting the root folder of your package. It facilitates getting resources (javascript add-ons, bundles, stylesheets, etc) using the environment object.
e.g. to load a stylesheet included in 'dist/assets/style.css' :
import pack from 'main'
function fetch(env: Environment){
return environment.fetchStyleSheets( `${pack.urlCDN}/dist/assets/style.css` )
}
version of the FluxPack, the package.json version if AUTO_GENERATED fields are used
Generated using TypeDoc
FluxPack
A FluxPack gather the description of the package to be properly consumed by Flux applications. It gather some basic information as well as the registered modules and plugins.
Modules/plugins registration is done automatically when using the decorator Flux (through the [[Flux.pack]] attribute).
The common scenario of FluxPack initialization is to use the AUTO_GENERATED data that is generated using the 'package.json' file at the first step of the build process (when using the pipeline flux-pack of the YouWol local environment).
It follows that most of the times FluxPack initialization is only about eventually providing an install function (e.g. when fetching additional resources is needed - see Environment in such cases) .
This is a typical FluxPack initialization when no install steps are needed:
This is a typical FluxPack initialization when some install steps are needed: