Bootstrap NES 3.4.x
How to configure Bootstrap NES
Installation
Review the Minimum Requirements before starting for a seamless installation.
Follow these steps:
- Update your
package.json
. - Create or update your
.npmrc
file. - Configure DOMPurify.
- Install and run.
There has been a change in Bootstrap NES's version naming scheme to be consistent with other NES packages. Please note that:
@neverendingsupport/bootstrap@3.4.8
is now
@neverendingsupport/bootstrap@3.4.1-bootstrap-3.4.8
Detailed Instructions
Substitute the Bootstrap dependencies in your package.json
with the following
{
"dependencies": {
"bootstrap": "npm:@neverendingsupport/bootstrap@3.4.1-bootstrap-3.4.8",
},
"overrides": {
"bootstrap": { ".": "npm:@neverendingsupport/bootstrap@3.4.1-bootstrap-3.4.8" },
}
}
Create or update your .npmrc
file with the following
Replace <nes-access-token>
with your NES access token.
@neverendingsupport:registry=https://registry.nes.herodevs.com/npm/pkg/
//registry.nes.herodevs.com/npm/pkg/:_authToken=<nes-access-token>
Configure DOMPurify
DOMPurify is a DOM-only, super-fast, open source, XSS sanitizer for HTML.
HeroDevs strongly recommends including 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 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:
{
"dependencies": {
// existing dependencies
"bootstrap": "npm:@neverendingsupport/bootstrap@3.4.1-bootstrap-3.4.8",
"dompurify": "^3.2.4",
},
"overrides": {
"bootstrap": { ".": "npm:@neverendingsupport/bootstrap@3.4.1-bootstrap-3.4.8" }
}
}
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 to import and bundle dependencies together in applications. Ensure that your application makes DOMPurify available on the window
object for it to work properly. Here is an example of how you could accomplish this within an application that uses Webpack.
module.exports = {
// ...
plugins: [
// ...
new webpack.ProvidePlugin({
'window.DOMPurify': 'dompurify',
}),
],
};
Option 2
Include DOMPurify from a CDN in your HTML template:
<html lang="en">
<head>
<title>Home</title>
<!-- ... -->
<script src="https://cdn.jsdelivr.net/npm/dompurify@3.2.4/dist/purify.min.js"></script>
<!-- ... -->
Install your dependencies
npm install
Now you can run your integration tests against Bootstrap NES.
Additional Information
Direct Download URLs
The direct download URL for Bootstrap NES is:
Package | URL |
---|---|
bootstrap 3.4.1-bootstrap-3.4.8 | Download |
Replace <package-name>
with the actual name of the package you want to download.