![Malicious npm Package Typosquats react-login-page to Deploy Keylogger](https://cdn.sanity.io/images/cgdhsj6q/production/007b21d9cf9e03ae0bb3f577d1bd59b9d715645a-1024x1024.webp?w=400&fit=max&auto=format)
Research
Security News
Malicious npm Package Typosquats react-login-page to Deploy Keylogger
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
vite-plugin-fast-external
Advanced tools
Readme
Without lexical transform, support custom external code
English | 简体中文
Like Webpack externals, support browser, Node.js and Electron
It's actually implemented by modify resolve.alias
By default window
is used as the environment object, you can also customize the code snippets by return string from function -- Real flexible 🎉
npm i vite-plugin-fast-external -D
import external from 'vite-plugin-fast-external';
export default defineConfig({
plugins: [
external({
// Simple example
// By default will generated code -> const Vue = window['Vue']; export { Vue as default }
vue: 'Vue',
// Custom external code by function
'@scope/name': () => `const Lib = window.ScopeName.Member; export default Lib;`,
// Read a template file and return Promise<string>
externalId: async () => await require('fs').promises.readFile('path', 'utf-8'),
// Use in Electron
electron: () => `const { ipcRenderer } = require('electron'); export { ipcRenderer }`,
})
]
})
export type Externals = Record<string, string | ((args: { dir: string; }) => string | Promise<string>)>;
export interface ExternalOptions {
/**
* Absolute path or relative path
* @default ".vite-plugin-fast-external"
*/
dir?: string;
}
Let's use Vue as an example
external({
vue: 'Vue',
})
node_modules/.vite-plugin-fast-external/vue.js
and contains the following codeconst vue = window['Vue']; export { vue as default }
vue
alias item and add it to resolve.alias
{
resolve: {
alias: [
{
find: 'vue',
replacement: 'User/work-directory/node_modules/.vite-plugin-fast-external/vue.js',
},
],
},
}
vue
to the optimizeDeps.exclude
by default.optimizeDeps.include
export default {
optimizeDeps: {
exclude: ['vue'],
},
}
FAQs
Unknown package
The npm package vite-plugin-fast-external receives a total of 2 weekly downloads. As such, vite-plugin-fast-external popularity was classified as not popular.
We found that vite-plugin-fast-external 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
Security News
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
Security News
The JavaScript community has launched the e18e initiative to improve ecosystem performance by cleaning up dependency trees, speeding up critical parts of the ecosystem, and documenting lighter alternatives to established tools.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.