Skip to content

Commit

Permalink
Merge pull request #847 from erickwilder/add-webpack-example
Browse files Browse the repository at this point in the history
docs(readme) Add webpack section to README file
  • Loading branch information
leongersen authored Jan 12, 2018
2 parents 856f5ad + 18f95bc commit 97716c4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,29 @@ noUiSlider.create(slider, {
});
```

Webpack
-------
In order to use this with webpack, the easiest way to work with it is by using the [`ProvidePlugin`](https://webpack.js.org/plugins/provide-plugin/):

```javascript
// webpack.config.js
var webpack = require('webpack');
...
plugins: [
new webpack.ProvidePlugin({
noUiSlider: 'nouislider'
})
]
...
```

If you're using ES6 imports, a simple [import with side effect](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Import_a_module_for_its_side_effects_only)
is enough:

```
import 'nouislider';
```

Browser support
---------------

Expand Down

0 comments on commit 97716c4

Please sign in to comment.