Templates

No AMD/UMD Template

This template utlizes CDNs, but no AMD.

{% highlight html %} {% include getting-started-globals-template.html %} {% endhighlight %}

AMD/UMD Template

This template utlizes CDNs and AMD modules (with a manager such as require.js) and bundling for production:

{% highlight html %} {% include getting-started-amd-template.html %} {% endhighlight %}

AMD/UMD Template, no CDN

This template does not utilize CDNs. It does utilize AMD modules (with a manager such as require.js) and bundling for production. Your setup will probably be different (This is a sample taken from fuelux-boilerplate project):

{% highlight html %} {% include getting-started-amd-template-no-cdn.html %} {% endhighlight %}

UMD/AMD Support

If you use AMD (such as RequireJS), we recommend only loading the controls you need (e.g.- fuelux/checkbox).

  1. Reference the Fuel UX directory in your paths configuration, wherever it is located:
    require.config({
            paths: {
                'fuelux': '{{site.cdn.js}}'
                //...
            }
        });
        
  2. List individual fuelux controls needed as dependencies within your application modules:
    define(function(require) {
        var spinbox = require('fuelux/spinbox');
        //...
    });
    

    In instances where you require every module from fuel ux, you can use fuelux/all instead of listing each module individually.

    Fuel UX also supports placing components in their own <script> tags. Be sure to check component dependencies in the controls documentation and put modules in the correct order if you load them in this method. Errors will appear in the console if you have not loaded dependencies correctly.

    The following components have dependencies:

CommonJS Support

If you use a CommonJS build system (such as Webpack or Browserify), we recommend only loading the controls you need. You can also load all the controls by including the npm package.

Working with Browserify

This should work out of the box with Browserify.

Working with webpack

  1. Install imports-loader for webpack {% highlight js %} npm install --save-dev imports-loader {% endhighlight %}
  2. Add rule to webpack configuration {% highlight js %} { test: /fuelux\/js\/.*\.js$/, use: ['imports-loader?define=>false'] } {% endhighlight %}
  3. Include individual modules or fuelux lib where needed {% highlight js %} // include where you need to require('fuelux/js/checkbox') // or require('fuelux') {% endhighlight %}

Migrating from v2.x to v3.x

Interested in migrating from an older version of Fuel UX to v3.x? Check out our migration guide.