Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
babel-plugin-postcss
Advanced tools
Replace import from css by content transformed by postcss
Input:
import style1 from './style.css';
import style2 from './style.css'; // options: { tagged: ['css', 'lit-element'] }
Output:
var style1 = '/* style.css content */';
import { css } from 'lit-element';
var style2 = css`
/* style.css content */
`;
npm install --save-dev babel-plugin-postcss
['babel-plugin-postcss', { options }]
to plugins section of babel config.Regular expression or function which test importee for being parsed as style file (css).
Type: RegExp | Function
Default: /\.css$/
Example: /\.css$/
only .css
imports will be parsed
If value is truthy css content will be processed by postcss,
postcss config will be loaded by postcss-load-config
.
Type: undefined | boolean
Default: undefined
Wrap css content to tagged template, array of two elements. First is tagged function,
second is module where import the tagged function from.
Type: undefined | [string, string]
Default: undefined
Example: ['css', 'lit-element']
Input:
import style3 from './style3.css';
Output:
import { css } from 'lit-element';
var style2 = css`
/* style3.css content */
`;
FAQs
Replace import from css by content transformed by postcss
We found that babel-plugin-postcss 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 a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.