Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
vite-plugin-inspect
Advanced tools
vite-plugin-inspect is a Vite plugin that provides an inspection tool for Vite projects. It allows developers to inspect the internal state of Vite, including module graph, plugin hooks, and more. This can be particularly useful for debugging and understanding how Vite processes your project.
Inspect Module Graph
This feature allows you to inspect the module graph of your Vite project. By including the Inspect plugin in your Vite configuration, you can visualize and understand the relationships between different modules in your project.
import Inspect from 'vite-plugin-inspect';
export default {
plugins: [
Inspect()
]
};
Inspect Plugin Hooks
This feature enables you to inspect the plugin hooks that are being called during the build process. By setting the `hooks` option to true, you can see detailed information about each plugin hook and its execution.
import Inspect from 'vite-plugin-inspect';
export default {
plugins: [
Inspect({
hooks: true
})
]
};
Inspect Transformations
This feature allows you to inspect the transformations applied to your code. By enabling the `transformations` option, you can see how your code is being transformed by different plugins and loaders.
import Inspect from 'vite-plugin-inspect';
export default {
plugins: [
Inspect({
transformations: true
})
]
};
rollup-plugin-visualizer is a plugin for Rollup that visualizes the size of the output files and their dependencies. It provides a treemap visualization of the bundle, which can help you understand the size and structure of your bundle. Compared to vite-plugin-inspect, rollup-plugin-visualizer focuses more on the size and structure of the final bundle rather than the internal state of the build process.
webpack-bundle-analyzer is a plugin for Webpack that provides a visual representation of the size and composition of your Webpack bundles. It generates an interactive treemap visualization of the contents of your bundles, helping you identify large modules and optimize your build. While vite-plugin-inspect focuses on the internal state of Vite, webpack-bundle-analyzer is more concerned with the final output of the build process.
Inspect the intermediate state of Vite plugins. Useful for debugging and authoring plugins.
npm i -D vite-plugin-inspect
Since
vite-plugin-inspect@v0.7.0
, Vite v3.1 or above is required.
Add plugin to your vite.config.ts
:
// vite.config.ts
import Inspect from 'vite-plugin-inspect'
export default {
plugins: [
Inspect()
],
}
Then run npm run dev
and visit localhost:5173/__inspect/ to inspect the modules.
To inspect transformation in build mode, you can pass the build: true
option:
// vite.config.ts
import Inspect from 'vite-plugin-inspect'
export default {
plugins: [
Inspect({
build: true,
outputDir: '.vite-inspect'
})
],
}
After running vite build
, the inspector client will be generated under .vite-inspect
, where you can use npx serve .vite-inspect
to check the result.
MIT License © 2021-PRESENT Anthony Fu
FAQs
Inspect the intermediate state of Vite plugins
The npm package vite-plugin-inspect receives a total of 452,917 weekly downloads. As such, vite-plugin-inspect popularity was classified as popular.
We found that vite-plugin-inspect demonstrated a healthy version release cadence and project activity because the last version was released less than 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
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.