Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
postcss-less-loader
Advanced tools
Readme
npm i -D postcss-less-loader
Configuration
postcss.config.js
module.exports = {
plugins: [
require('autoprefixer')
]
}
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.s[ca]ss$/,
use: [ 'style-loader', 'css-loader', 'postcss-less-loader' ]
}
]
}
}
webpack.config.js
(recommended)
module.exports = {
module: {
rules: [
{
test: /\.css$/,
use: [
'style-loader',
{ loader: 'css-loader', options: { alias: { "@test": "/home/test"} } },
'postcss-less-loader'
]
}
]
}
}
Name | Type | Default | Description |
---|---|---|---|
config | {Object} | undefined | Set postcss.config.js config path && ctx |
plugins | {Array|Function} | [] | Set PostCSS Plugins |
sourceMap | {String|Boolean} | false | Enable Source Maps |
alias | {Object} | undefined | Set import alias |
Plugins
webpack.config.js
{
loader: 'postcss-less-loader',
options: {
ident: 'postcss',
plugins: (loader) => [
require('postcss-import')({ root: loader.resourcePath }),
require('postcss-preset-env')(),
require('cssnano')()
]
}
}
alias
webpack.config.js
{
test: /\.s[ca]ss$/,
use: [
'style-loader',
'css-loader',
{
loader: 'postcss-less-loader',
options: {
alias: {
"@test": "/home/test"
}
}
}
]
}
⚠️ webpack requires an identifier (
ident
) inoptions
when{Function}/require
is used (Complex Options). Theident
can be freely named as long as it is unique. It's recommended to name it (ident: 'postcss'
)
Autoprefixing
webpack.config.js
{
test: /\.s[ca]ss$/,
use: [
'style-loader',
'css-loader',
{
loader: 'postcss-less-loader',
options: {
plugins: [
require('autoprefixer')({...options}),
...,
]
}
}
]
}
FAQs
PostCSS Loader Loader for webpack to process LESS with PostCSS
The npm package postcss-less-loader receives a total of 173 weekly downloads. As such, postcss-less-loader popularity was classified as not popular.
We found that postcss-less-loader 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.