
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
rollup-plugin-static-files
Advanced tools
Copies static files into output directory with support for hash replacement.
Rollup plugin that copies over static files from the specified directories into the output directory.
It also modifies HTML files to override hash values with the hash values generated by Rollup.
npm install rollup-plugin-static-files
let static_files = require('rollup-plugin-static-files');
module.exports = {
...
plugins: [
static_files({
include: ['./public'],
exclude: ['./public/userdata']
})
]
}
All HTML files are scanned for script
and link
tags. The src
and href
attributes are checked and if they match any emitted assets/chunks/entries, those attributes are replaced.
Your index file should refer to these files using their final names, generated by assetFileNames
/entryFileNames
/chunkFileNames
, with the exception of [hash]
. That should not be replaced.
Example:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/styles.[hash].css" type="text/css">
</head>
<body>
<div id="app"></div>
<script src="/main.[hash].js"></script>
</body>
</html>
If a HTML file includes files that start with a subdirectory, but this subdirectory is only mentioned in the output.dir
option and not in output.entryFileNames
etc, then use this option to make the plugin aware that all outputs start with this subdirectory.
Example:
output: {
dir: 'dist/client',
entryFileNames: '[name].[hash].js'
}
<script src="/client/main.[hash].js"></script>
For the plugin:
static_files({
include: ['./public'],
publicPath: '/client'
})
FAQs
Copies static files into output directory with support for hash replacement.
We found that rollup-plugin-static-files demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.