Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
metalsmith-browserify
Advanced tools
A metalsmith plugin to bundle javascript with browserify
This plugin allows you to bundle your javascript with browserify. Pass it the entry points it should bundle, and it will replace those files with the resulting bundle on build.
For support questions please use stack overflow or our slack channel. For browserify specific questions try their documentation.
$ npm install metalsmith-browserify
You can pass options to metalsmith-browserify
with the Javascript API or CLI. The options are:
metalsmith-browserify
will exit with an error if a file can't be found. Enabling this option will suppress that error.entries
The entry points that should be browserified. So this metalsmith.json
:
{
"source": "src",
"destination": "build",
"plugins": {
"metalsmith-browserify": {
"entries": [
"index.js",
"another.js"
]
}
}
}
Would browserify both ./src/index.js
and ./src/another.js
and output them as ./build/index.js
and ./build/another.js
respectively.
Note that if the entry path is nested, the paths may differ across operating systems. Make sure you're using the correct directory separators, or use node's path.join to make sure the path will work anywhere.
browserifyOptions
Use this to pass options to browserify. So this metalsmith.json
:
{
"source": "src",
"destination": "build",
"plugins": {
"metalsmith-browserify": {
"entries": ["index.js"],
"browserifyOptions": {
"debug": true
}
}
}
}
Would enable browserify's debug option and add a source map to the bundle.
suppressNotFoundError
metalsmith-browserify
exits with an error if it can’t find an entry file. If you’re doing any kind of incremental builds via something like metalsmith-watch
, this is problematic as you’re likely only rebuilding files that have changed. This flag allows you to suppress that error:
{
"source": "src",
"destination": "build",
"plugins": {
"metalsmith-browserify": {
"entries": ["index.js"],
"suppressNotFoundError": true
}
}
}
Note that when this option is turned on, if you're logging debug messages, you’ll still see a message denoting which files metalsmith-browserify cannot find.
If you're encountering problems you can use debug to enable verbose logging. To enable debug
prefix your build command with DEBUG=metalsmith-browserify
. So if you normally run metalsmith
to build, use DEBUG=metalsmith-browserify metalsmith
(on windows the syntax is slightly different).
MIT
FAQs
Metalsmith plugin to bundle JS with browserify
We found that metalsmith-browserify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.