Registry / devops / save-remote-file-webpack-plugin

save-remote-file-webpack-plugin

JSON →
library1.1.0jsnpmunverified

Webpack 4 plugin that downloads remote files (e.g., analytics.js) during the build process and saves them locally with content hashes for cache busting. Version 1.1.0 is the latest stable release, offering a `hash` option to toggle content hashing. It integrates with `manifest-webpack-plugin` by emitting downloaded files. Designed for developers needing to self-host external scripts without manual downloads or build hooks.

npm install save-remote-file-webpack-plugin
INSTALL
IMPORT
SIG · SAVE-REMOTE-FILE-W
S
save-remote-file-webpack-plugin
devopsjavascriptv1.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SaveRemoteFilePlugin
const SaveRemoteFilePlugin = require('save-remote-file-webpack-plugin');
import SaveRemoteFilePlugin from 'save-remote-file-webpack-plugin';
Plugin is CommonJS only; ESM import does not work unless transpiled or using bundler resolution.
SaveRemoteFilePlugin
const { default: SaveRemoteFilePlugin } = require('save-remote-file-webpack-plugin');
const { SaveRemoteFilePlugin } = require('save-remote-file-webpack-plugin');
Do not use named export; the plugin is exported as default, not named.
SaveRemoteFilePlugin
new SaveRemoteFilePlugin([{ url: '...', filepath: '...' }])
new SaveRemoteFilePlugin({ url: '...', filepath: '...' })
Constructor expects an array of option objects, even for a single file.

Shows how to require and configure the plugin in a webpack 4 config, downloading one remote file with content hashing enabled.

const SaveRemoteFilePlugin = require('save-remote-file-webpack-plugin'); module.exports = { entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js', }, plugins: [ new SaveRemoteFilePlugin([ { url: 'https://example.com/external.js', filepath: 'js/external.js', hash: true, }, ]), ], };
Debug
Known issues
breakingIn version 1.0.0, files were saved without content hashes. Upgrade to >=1.0.1 for hash support.
fix
Update to version 1.0.1 or later: npm install save-remote-file-webpack-plugin@latest
affects: <=1.0.0
gotchaThe plugin expects an array of option objects, even for a single file. Passing an object will cause an error.
fix
Wrap single config in an array: new SaveRemoteFilePlugin([{ url: '...', filepath: '...' }])
affects: >=1.0.0
gotchaThe imported module is the default export, not a named export. Destructuring will result in undefined.
fix
Use require('save-remote-file-webpack-plugin') directly, not { SaveRemoteFilePlugin }.
affects: >=1.0.0
deprecatedPlugin is designed for webpack 4 only; not guaranteed to work with webpack 5 due to internal API changes.
fix
Consider using webpack 5 compatible alternatives or migrate to fetch in build scripts.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: SaveRemoteFilePlugin is not a constructor
Using named import via destructuring, which returns undefined.
fix
Use const SaveRemoteFilePlugin = require('save-remote-file-webpack-plugin');
Error: options must be an array
Passing a single object instead of an array to the constructor.
fix
Wrap option in array: new SaveRemoteFilePlugin([{ url: '...', filepath: '...' }])
Error: Cannot find module 'download'
Missing dependency 'download' which is required at runtime.
fix
Install the 'download' package: npm install download
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
webpackrequiredPeer dependency; plugin targets webpack 4
downloadrequiredUsed to download remote files without temporary disk storage
Agent activity
4 hits · last 30 days
node
4
Resources
save-remote-file-webpack-plugin — npm install save-remote-file-webpack-plugin · libregistry