https://github.com/constgen/html-webpack-noscript-plugin
https://github.com/constgen/html-webpack-noscript-plugin
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/constgen/html-webpack-noscript-plugin
- Owner: constgen
- License: mit
- Created: 2021-01-17T15:52:28.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-09T12:33:39.000Z (over 5 years ago)
- Last Synced: 2025-02-08T19:46:25.005Z (over 1 year ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# html-webpack-noscript-plugin
[![NPM version][npm-image]][npm-url]
[![NPM downloads][npm-downloads]][npm-url]
[![NPM Package][workflow-status]][actions]
Webpack Plugin that extends HtmlWebpackPlugin template with `` tag with arbitrary HTML content inside
## Installation
`html-webpack-noscript-plugin` can be installed using NPM. Inside your project, make sure `html-webpack-plugin` is a development dependency.
```bash
npm install --save-dev html-webpack-plugin html-webpack-noscript-plugin
```
## Setup
This plugin should go after `HtmlWebpackPlugin` in the `plugins` config
**webpack.config.js**
```js
let HtmlWebpackPlugin = require('html-webpack-plugin')
let HtmlWebpackNoscriptPlugin = require('html-webpack-noscript-plugin')
const DISABLED_JAVASCRIPT_MESSAGE = `We're sorry but our app doesn't work properly without JavaScript enabled. Please enable it to continue.`
module.exports = {
plugins: [
new HtmlWebpackPlugin(),
new HtmlWebpackNoscriptPlugin(DISABLED_JAVASCRIPT_MESSAGE)
]
}
```
This will affect the compiled HTML file
**index.html**
```html
Webpack App
We're sorry but our app doesn't work properly without JavaScript enabled. Please enable it to continue.
```
[npm-image]: https://img.shields.io/npm/v/html-webpack-noscript-plugin.svg
[npm-downloads]: https://img.shields.io/npm/dt/html-webpack-noscript-plugin.svg
[npm-url]: https://npmjs.org/package/html-webpack-noscript-plugin
[actions]: https://github.com/constgen/html-webpack-noscript-plugin/actions
[workflow-status]: https://github.com/constgen/html-webpack-noscript-plugin/workflows/NPM%20Package/badge.svg?branch=main