Neutrino middleware that adds <noscript>
tag with a message as the very first child of <body>
- Node.js v10+
- Neutrino v9
- Webpack v4
- HtmlWebpackPlugin v4.5.1+
@constgen/neutrino-html-noscript
can be installed from NPM. You should install it to "dependencies"
(--save) or "devDependncies"
(--save-dev) depending on your goal.
npm install --save @constgen/neutrino-html-noscript
Require this package and plug it into Neutrino. The following shows how you can pass an options object to the middleware, showing the defaults:
let noscript = require('@constgen/neutrino-html-noscript')
neutrino.use(noscript(
'We’re sorry but our app doesn’t work properly without JavaScript enabled. Please enable it to continue.'
))
The middleware also may be used together with another presets in Neutrino rc-file, e.g.:
.neutrinorc.js
let noscript = require('@constgen/neutrino-html-noscript')
module.exports = {
use: [
noscript()
]
}