Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1989 from vernak2539/gh-pages
Browse files Browse the repository at this point in the history
Adds section for commonjs support
  • Loading branch information
swilliamset authored Jun 7, 2017
2 parents f045646 + d6ea268 commit ff8e6b5
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions _includes/getting-started-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,40 @@ <h3>

</div>

<h3><a name="user-content-commonjs-support" class="anchor" href="#commonjs-support"><span class="octicon octicon-link"></span></a>CommonJS Support</h3>

<p>If you use a CommonJS build system (such as <a href="https://webpack.github.io/">Webpack</a> or <a href="http://browserify.org/">Browserify</a>), we recommend only loading the controls you need. You can also load all the controls by including the npm package.</p>

<h4>Working with Browserify</h4>

<p>This should work out of the box with Browserify.</p>

<h4>Working with webpack</h4>

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

<div class="fu-docs-section">
<!-- Cross link to new migration page -->
<div class="fu-callout fu-callout-info">
Expand Down

0 comments on commit ff8e6b5

Please sign in to comment.