{"id":19445,"library":"disable-output-webpack-plugin","title":"disable-output-webpack-plugin","description":"Webpack plugin that prevents saving output files to disk, useful for scenarios where you only need webpack's in-memory compilation (e.g., with webpack-dev-server or custom runners). Version 1.0.1 is current, no frequent releases. Simple no-config plugin, lighter than alternatives like `webpack-disk-plugin`. Likely no longer needed with webpack 5's `output.writeToDisk` option.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/mrac/disable-output-webpack-plugin","tags":["javascript","disable","saving","output","files","webpack","plugin"],"install":[{"cmd":"npm install disable-output-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add disable-output-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add disable-output-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package does not export ES modules correctly; use CommonJS require.","wrong":"import DisableOutputWebpackPlugin from 'disable-output-webpack-plugin'","symbol":"DisableOutputWebpackPlugin","correct":"const DisableOutputWebpackPlugin = require('disable-output-webpack-plugin')"},{"note":"The package exports a single constructor function, not a named export.","wrong":"const { DisableOutputWebpackPlugin } = require('disable-output-webpack-plugin')","symbol":"default","correct":"const DisableOutputWebpackPlugin = require('disable-output-webpack-plugin')"},{"note":"The constructor takes no arguments; passing options will be ignored.","wrong":"new DisableOutputWebpackPlugin({})","symbol":"new","correct":"new DisableOutputWebpackPlugin()"}],"quickstart":{"code":"// webpack.config.js\nconst DisableOutputWebpackPlugin = require('disable-output-webpack-plugin');\n\nmodule.exports = {\n  entry: './src/index.js',\n  output: {\n    path: '/dev/null', // still required but output won't be written\n    filename: 'bundle.js'\n  },\n  plugins: [\n    new DisableOutputWebpackPlugin()\n  ]\n};","lang":"javascript","description":"Basic setup to disable webpack output file writing. Note: output.path is still needed but files are not saved."},"warnings":[{"fix":"Use webpack 5's built-in `output.writeToDisk: false` instead.","message":"The plugin only works with webpack 4 and lower; webpack 5 has native support via `output.writeToDisk: false`.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Remove any arguments from `new DisableOutputWebpackPlugin()`.","message":"The constructor accepts no options; passing any argument will be silently ignored.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Remove the plugin; webpack-dev-server handles in-memory compilation.","message":"If using webpack-dev-server, output is already not written to disk by default, making this plugin redundant.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use `const DisableOutputWebpackPlugin = require('disable-output-webpack-plugin')` instead of `import`.","cause":"Using ES module import syntax (`import DisableOutputWebpackPlugin from ...`) which doesn't resolve to the CommonJS export correctly.","error":"TypeError: DisableOutputWebpackPlugin is not a constructor"},{"fix":"Run `npm install --save-dev disable-output-webpack-plugin`.","cause":"Package not installed or missing from node_modules.","error":"Module not found: Error: Can't resolve 'disable-output-webpack-plugin'"},{"fix":"Ensure other plugins like MiniCssExtractPlugin are properly configured if used.","cause":"Not related to this plugin; it's a common confusion with other plugins.","error":"Error: You forgot to add 'mini-css-extract-plugin' plugin"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}