Bootstrap-Sass 3.4.x

How to configure Bootstrap-Sass NES

Minimum Requirements

Please review our Minimum Requirements to ensure a smooth installation.

Instruction Overview

Follow 5 easy steps:

  1. Determine which version of Bootstrap-Sass NES you need to use
  2. Update your package.json
  3. Create or update your .npmrc file
  4. Configure DOMPurify
  5. Install & Run!

Detailed Instructions

Determine which version of Bootstrap-Sass you need.

There are two different versions maintained for Bootstrap-Sass NES. Learn which one is right for your application.

Substitute the Bootstrap-Sass dependencies in your package.json with the following:

3.4.1-bootstrap-sass-3.4.6
3.4.3-bootstrap-sass-3.4.5
{
  "dependencies": {
    "bootstrap-sass": "npm:@neverendingsupport/bootstrap-sass@3.4.1-bootstrap-sass-3.4.6"
  },
  "overrides": {
    "bootstrap-sass": { ".": "npm:@neverendingsupport/bootstrap-sass@3.4.1-bootstrap-sass-3.4.6" }
  }
}

Create an .npmrc file with the following

.npmrc
@neverendingsupport:registry=https://registry.nes.herodevs.com/npm/pkg/
//registry.nes.herodevs.com/npm/pkg/:_authToken=<YOUR_NES_ACCESS_TOKEN>

Configure DOMPurify

DOMPurify is a DOM-only, super-fast, open source, XSS sanitizer for HTML.

HeroDevs strongly recommends that you include DOMPurify as a dependency along with your Bootstrap NES 3.4.5+ packages to provide optimal security protection for your application.

Bootstrap NES 3.4.5 and above will automatically detect DOMPurify and utilize it as needed. For this to happen, DOMPurify must be available on the window object. There are various ways to achieve this depending on your setup.

Option 1

Add the DOMPurify dependency to your package.json with the following:

3.4.1-bootstrap-sass-3.4.6
3.4.3-bootstrap-sass-3.4.5
{
  "dependencies": {
    // existing dependencies
    "bootstrap-sass": "npm:@neverendingsupport/bootstrap@3.4.1-bootstrap-sass-3.4.6"
    "dompurify": "^3.2.4",
  },
  "overrides": {
    "bootstrap-sass": { ".": "npm:@neverendingsupport/bootstrap@3.4.1-bootstrap-sass-3.4.6" }
  }
}

Then ensure node_modules/dompurify/dist/purify[.min].js is included in your application, either as a standalone script or in your application bundle.

There are many ways in which dependencies are imported and bundled together in applications. You must ensure that your application makes DOMPurify available on the window object in order for it to work properly. Here is an example of how it could be accomplished within an application that uses Webpack.

webpack.config.js

module.exports = {
  // ...
  plugins: [
    // ...
    new webpack.ProvidePlugin({
      'window.DOMPurify': 'dompurify',
    }),
  ],
};

Option 2

Include DOMPurify from a CDN in your HTML template:

index.html
<html lang="en">
  <head>
    <title>Home</title>
    <!-- ... -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.2.4/purify.min.js"></script>
    <!-- ... -->

Install your dependencies

.npmrc

npm install

And just like that, you can run your integration tests against Bootstrap-Sass NES!

Additional Information

Direct download URLs

The direct download URLs for Bootstrap-Sass NES are:

PackageURL
bootstrap-sass
3.4.1-bootstrap-sass-3.4.6
Download
bootstrap-sass
3.4.3-bootstrap-sass-3.4.5
Download