Skip to content
Webpack loader for bootstrap.native.
Branch: master
Clone or download
fleck Merge pull request #4 from ShawnCorrigan/patch-2
Added list of valid Bootstrap components
Latest commit 9aefc41 Sep 6, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Preparing to add tests, fix syntax to conform to standardjs. Jan 18, 2018
README.md
index.js
package.json
yarn.lock Preparing to add tests, fix syntax to conform to standardjs. Jan 18, 2018

README.md

bootstrap.native-loader

This is a webpack loader for bootstrap.native.

yarn add bootstrap.native
yarn add --dev bootstrap.native-loader

In your webpack config file, in the rules array, add this object. This will compile all of the bootstrap.native modules.

{
  test: /bootstrap\.native/,
  use: {
    loader: 'bootstrap.native-loader'
  }
}

There's also an only option. (cannot be used at the same time as the ignore option)

{
  test: /bootstrap\.native/,
  use: {
    loader: 'bootstrap.native-loader',
    options: {
      only: ['modal', 'dropdown']
    }
  }
}

Also, an ignore option. (cannot be used at the same time as the only option)

{
  test: /bootstrap\.native/,
  use: {
    loader: 'bootstrap.native-loader',
    options: {
      ignore: ['carousel', 'button']
    }
  }
}

A full list of components that can be listed under ignore or only are shown below.

['alert', 'button',  'carousel', 'collapse', 'dropdown', 'modal', 'popover', 'scrollspy', 'tab', 'tooltip']

Once you have the above setup in your add the code below to include the custom build in your bundle.

import 'bootstrap.native';

or if you use require

require('bootstrap.native');
You can’t perform that action at this time.