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

Adds section for commonjs support #1989

Merged
merged 3 commits into from
Jun 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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