This template utlizes CDNs, but no AMD.
{% highlight html %} {% include getting-started-globals-template.html %} {% endhighlight %}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 %}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 %}If you use AMD (such as RequireJS), we recommend only loading the controls you need (e.g.- fuelux/checkbox).
require.config({
paths: {
'fuelux': '{{site.cdn.js}}'
//...
}
});
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:
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.
This should work out of the box with Browserify.
imports-loader for webpack
{% highlight js %}
npm install --save-dev imports-loader
{% endhighlight %}
Interested in migrating from an older version of Fuel UX to v3.x? Check out our migration guide.