
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
vite-plugin-import-css-sheet
Advanced tools
Small plugin that enables the use of tc39/proposal-import-attributes for css files in vite.
Small plugin that enables the use of tc39/proposal-import-attributes for css files in vite.
Any imported .css file that uses the with/assert syntax will be imported as a CSSStyleSheet
.
This plugin only covers .css imports and nothing else.
npm i vite-plugin-import-css-sheet --save-dev
pnpm add -D vite-plugin-import-css-sheet
import { defineConfig } from 'vite';
import { viteImportCssSheet } from 'vite-plugin-import-css-sheet';
export default defineConfig({
plugins: [
viteImportCssSheet(),
],
});
For typings to work correctly, in your tsconfig.json file add the following:
{
"compilerOptions": {
"types": [
"vite-plugin-import-css-sheet/client"
]
},
}
This adds the correct type to .css file imports.
If you also use vite/client typings, vite-plugin-import-css-sheet/client
must be below it.
New correct syntax.
import style from './button.css' with { type: 'css' };
Also works with the previous assert syntax.
import style from './button.css' assert { type: 'css' };
FAQs
Small plugin that enables the use of tc39/proposal-import-attributes for css files in vite.
The npm package vite-plugin-import-css-sheet receives a total of 1 weekly downloads. As such, vite-plugin-import-css-sheet popularity was classified as not popular.
We found that vite-plugin-import-css-sheet 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 uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.