A Webpack plugin generates a browser-side standalone script that detects browser compatibility based on `Browserslist` and prompts website users to upgrade it.
npm install webpack-obsolete-pluginsh
npm i -D webpack-obsolete-plugin
`
$3
Apply the plugin in your Webpack configuration, often used together with html-webpack-plugin. By the way, the putting order of plugins is irrelevant.
`js
const HtmlWebpackPlugin = require('html-webpack-plugin');
const WebpackObsoletePlugin = require('webpack-obsolete-plugin');
module.exports = {
// ...
plugins: [
// ...
new HtmlWebpackPlugin(),
new WebpackObsoletePlugin()
]
};
`
$3
Apply script to you'r main html file, pass to obsolete function browsers thet you support.
`js
// or you'r own path to obsolete.js
`
Configuration
$3
| Name | Type | Default | Description
| ------------- |:-------------:|:-------------:|:-------------:|
| template | string | Animated html | You can paste any custom html you want, it will replace default. In addition you can place {{browsers}} in your html, it will be replaced with browsers from your Browserslist. Links without the "href" attribute will be fire new tab and display supported browsers from your Browserslist.|
| isStrict | boolean | false |This option ensures that if the browser being used does not exist in Browserslist then alert will be shown.
Example: You'r Browserslist contains chrome 95, edge 100 as supported browsers, used browser is Edge 95
If option isStrict: true => alert will be shown.
If option isStrict: false => As Edge browser supports Chrome features(wich ensure by userAgent), alert don't be shown|
Browser Support
The name matches Browserslist queries.
$3
IE | Edge | Chrome | Safari | Firefox | Opera | Electron
:-: | :-: | :-: | :-: | :-: | :-: | :-:
 |  |  |  |  |  | 
$3
ChromeAndroid | Android
(5+, WebView) | iOS
(OS)
:-: | :-: | :-:
 |  | 
FAQ
Q: Does this plugin support Yandex, Maxthon, UC or QQ browser?
A: Yep. This plugin supports those browsers based on the mainstream browser kernel, such as Chromium based browser, Mozilla based browser. In other words, Chrome >= 30 will be also applied to Yandex browser, ChromeAndroid >= 30` will be also applied to Android UC browser.