npm install alf bower install alf
There are 2:
alf.js- Default. Defaults to depending on jQuery (browser support), but also works with Zepto ((browser support). You may switch to Zepto in your bundler config (see below).
alf-deps.js- Bundled with Zepto. All-in-one bundle with all dependencides included. Can also be included in your own app-bundle using a module bundler, but that's only recommended if your app is centered mainly around ALF. Consider using
alf.jsif you have overlapping dependencies.
ALF is using the UMD pattern. This means that it will look for dependencies and register itself in the system it finds first of the following:
Example config using Webpack with NPM
moduleexports =entry:'my-bundle': "./my-app.js"output:path: __dirname + '/dist'filename: '[name].js'libraryTarget: 'var'library: 'MyApp'resolve:root:// Use this to make Webpack always prefer locally installed modules instead of the ones inside ALF. This will prevent including dependencies twice in your bundle (like lodash)pathalias:// This is recommended, as it will prevent submodules from using underscore when lodash is available. Will reduce the file size.underscore: 'lodash'// Use to replace with zepto when using ALF without dependenciesjquery: 'npm-zepto';