{"id":27547,"library":"webpack-prettier-plugin","title":"webpack-prettier-plugin","description":"A webpack plugin that automatically reformats code (JavaScript, JSON, CSS, Sass) using Prettier during the build process. Version 1.0.3 is the latest, with an unknown release cadence. Its key differentiator is simplicity—three steps to integrate. However, it is a minimal wrapper around Prettier with limited documentation and no active development, making it less robust than alternatives like prettier-webpack-plugin.","status":"maintenance","version":"1.0.3","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","Prettier","Webpack","Webpack Plugin","Plugin","Code Reformat"],"install":[{"cmd":"npm install webpack-prettier-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-prettier-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-prettier-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; required for actual formatting","package":"prettier","optional":false}],"imports":[{"note":"Package does not export ESM; use CommonJS require().","wrong":"import WebpackPrettierPlugin from 'webpack-prettier-plugin'","symbol":"default","correct":"const WebpackPrettierPlugin = require('webpack-prettier-plugin')"},{"note":"Default export is the plugin class, not named.","wrong":"const { WebpackPrettierPlugin } = require('webpack-prettier-plugin')","symbol":"WebpackPrettierPlugin","correct":"const WebpackPrettierPlugin = require('webpack-prettier-plugin')"},{"note":"Misleading alias; the constructor is the default export.","wrong":"new require('webpack-prettier-plugin').PrettierPlugin()","symbol":"PrettierPlugin","correct":"new (require('webpack-prettier-plugin'))()"}],"quickstart":{"code":"// webpack.config.js\nconst WebpackPrettierPlugin = require('webpack-prettier-plugin');\n\nmodule.exports = {\n  // ... other config\n  plugins: [\n    new WebpackPrettierPlugin()\n  ]\n};","lang":"javascript","description":"Demonstrates registration of the plugin in webpack.config.js using CommonJS require() and instantiation."},"warnings":[{"fix":"Use const WebpackPrettierPlugin = require('webpack-prettier-plugin') instead of import.","message":"Plugin does not support ESM import syntax. Must use require().","severity":"gotcha","affected_versions":"<=1.0.3"},{"fix":"Use const WebpackPrettierPlugin = require('webpack-prettier-plugin'); new WebpackPrettierPlugin()","message":"The plugin name in the README example uses PrettierPlugin but the actual export is WebpackPrettierPlugin.","severity":"gotcha","affected_versions":"<=1.0.3"},{"fix":"Ensure prettier is installed as a devDependency: npm install --save-dev prettier","message":"No explicit error if prettier is not installed; may fail silently.","severity":"gotcha","affected_versions":"<=1.0.3"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install --save-dev webpack-prettier-plugin","cause":"Package not installed or misspelled","error":"Cannot find module 'webpack-prettier-plugin'"},{"fix":"Use const WebpackPrettierPlugin = require('webpack-prettier-plugin'); new WebpackPrettierPlugin()","cause":"Using named import instead of default require()","error":"TypeError: WebpackPrettierPlugin is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}