Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
vite-plugin-dev-external
Advanced tools
开发过程中排除特定依赖项. 可以和build.rollupOptions.external
很好的配合使用.
ps: 这只是一个补丁. 本插件破坏了插件的加载顺序.
该项目灵感来源于: MilanKovacic/vite-plugin-externalize-dependencies
npm i -D vite-plugin-dev-external
安装插件后,导入它,并将其添加到 Vite 配置中:
例如你使用了socket.io
并开启了socket.io
的serveClient
选项:
import { defineConfig } from 'vite';
import externalize from 'vite-plugin-dev-external';
export default defineConfig({
build: {
rollupOptions: {
external: ['/socket.io/socket.io.esm.min.js'],
},
},
plugins: [externalize()],
});
或者你只需要在开发中使用它:
import { defineConfig } from 'vite';
import externalize from 'vite-plugin-dev-external';
export default defineConfig({
plugins: [externalize({
external: [
'externalized-dependency',
'/absolute/path/externalized-dependency',
],
})],
});
本插件也能和resolve.alias
选项很好配合:
import { defineConfig } from 'vite';
import externalize from 'vite-plugin-dev-external';
export default defineConfig({
build: {
rollupOptions: {
external: ['/socket.io/socket.io.esm.min.js'],
},
},
resolve: {
alias: {
'socket.io': '/socket.io/socket.io.esm.min.js',
},
},
plugins: [externalize()],
});
The plugin is intended to be consumed by Vite.
This project is licensed under the MIT License.
FAQs
开发过程中排除特定依赖项.
The npm package vite-plugin-dev-external receives a total of 3 weekly downloads. As such, vite-plugin-dev-external popularity was classified as not popular.
We found that vite-plugin-dev-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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.