A Webpack plugin that creates and mounts a RAM disk for blazing fast build output, using the OS native filesystem instead of in-memory JS filesystems. v0.2.0 is the latest stable release (infrequent updates). Key differentiators: prevents excessive SSD writes during HMR, supports both macOS and Linux, integrates as a standard Webpack plugin. Unlike webpack-virtual-modules or memfs, this leverages real OS-level RAM drives for true I/O speed. Requires Node >=10 and Webpack 4 or 5.
npm install webpack-plugin-ramdiskVerified import paths — ran on the pinned version, not inferred.
Basic Webpack configuration using the RAM disk plugin with output path and plugin options.
Set output.path to a path relative to the RAM disk root (e.g., '/myapp/dist'). Do not prefix '/Volumes/wpr' or '/mnt/wpr' manually.
Use alternative in-memory filesystem like memfs or webpack-virtual-modules for cross-platform builds.
Ensure the mount point directory does not exist before running the plugin (e.g., remove /Volumes/wpr or /mnt/wpr). The plugin will create it.
Increase the `bytes` option to accommodate your build output size. Use process.memoryUsage() or estimate output size.
Call WebpackPluginRamdisk.cleanup(diskPath) manually in your script's exit handler (e.g., process.on('exit', ...)).Ensure the plugin is configured correctly and the system supports RAM disks. On macOS, run 'diskutil info /Volumes/wpr' to check. On Linux, ensure /mnt exists and is writable.
Increase the `bytes` option in plugin configuration. Calculate required size: output size (e.g., webpack-bundle-analyzer) + 20% margin.
Use: const { WebpackPluginRamdisk } = require('webpack-plugin-ramdisk'); or import { WebpackPluginRamdisk } from 'webpack-plugin-ramdisk';