
Security News
npm Phishing Email Targets Developers with Typosquatted Domain
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
vite-plugin-lib-css-injection
Advanced tools
A vite plugin that would inject the css file into your bundled js file.
An enhancement vite plugin of vite-plugin-libcss that would inject the css file into your bundled js file.
Only support for ESM and library-mode
pnpm install vite-plugin-lib-css-injection --save -D
import libCss from 'vite-plugin-lib-css-injection'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [libCss()],
build: {
lib: {
entry: path.resolve(__dirname, './src/main.ts'),
},
rollupOptions: {
output: [
{
dir: 'dist/esm',
format: 'es',
entryFileNames: 'index.js',
}
],
},
},
})
build result like:
// dist/esm/index.js
import "./style.css"
// rest of your bundled js file code
and if there is no rollupOptions
but lib.fileName
, this plugin will also work!
lib: {
fileName() {
return 'esm/index.js'
}
}
build result like:
// dist/esm/index.js
import "../style.css"
// rest of your bundled js file code
That means this plugin will according to the entry filename to change the relative path of css file.
// vite.config.js
const libCss = require('vite-plugin-lib-css-injection')
module.exports = {
plugins: [libCss()]
}
FAQs
A vite plugin that would inject the css file into your bundled js file.
The npm package vite-plugin-lib-css-injection receives a total of 7 weekly downloads. As such, vite-plugin-lib-css-injection popularity was classified as not popular.
We found that vite-plugin-lib-css-injection 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
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.