A webpack plugin to generate a robots.txt file for your project. Version 8.0.0 is current, released August 2022. It requires webpack 5+ and Node.js >=14.15.0. Built on top of generate-robotstxt, it supports all options from that package. Simplified setup compared to manual creation, integrates with webpack's asset pipeline. Last update was 2022; no recent activity, but still functional for webpack 5 projects.
npm install robotstxt-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Configures webpack to output a robots.txt disallowing all crawlers.
Upgrade webpack to version 5 or later.
Upgrade Node.js to version 14.15.0 or later.
Use the new class name RobotstxtPlugin instead of RobotstxtWebpackPlugin.
Replace RobotstxtWebpackPlugin with RobotstxtPlugin.
Use const RobotstxtPlugin = require('robotstxt-webpack-plugin'); (default export directly).Run npm install --save-dev robotstxt-webpack-plugin
Use new class name RobotstxtPlugin.
Ensure generate-robotstxt is installed: npm install generate-robotstxt