Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
windicss-webpack-plugin
Advanced tools
:leaves: Windi CSS for webpack️
Next generation utility-first CSS framework.
tailwind.config.js
@apply
/ @screen
directives in any file: Less, SCSS, SASS, PostCSS, Stylusbg-gray-200 hover:(bg-gray-100 text-red-300)
yarn add windicss-webpack-plugin -D
# npm i windicss-webpack-plugin -D
If you have access to modify the webpack.config.js directly, then you can do the following.
// webpack.config.js
import WindiCSS from 'windicss-webpack-plugin'
export default {
// ...
plugins: [
new WindiCSS
],
};
// main.js
import 'windi.css'
// windi.config.ts
import { defineConfig } from 'windicss-webpack-plugin'
Enabled it by
```ts
// windi.config.ts
import { defineConfig } from 'windicss-webpack-plugin'
function range(size, startAt = 1) {
return Array.from(Array(size).keys()).map(i => i + startAt);
}
export default defineConfig({
safelist: [
range(30).map(i => `p-${i}`), // p-1 to p-3
range(10).map(i => `mt-${i}`) // mt-1 to mt-10
]
})
On server start, windicss-webpack-plugin
will scan your source code and extract the utilities usages. By default,
only files under src/
with extensions vue, html, mdx, pug, jsx, tsx
will be included. If you want to enable scanning for other file type of locations, you can configure it via:
// windi.config.js
import { defineConfig } from 'windcss/helpers'
export default defineConfig({
extract: {
include: ['src/**/*.{vue,html,jsx,tsx}'],
exclude: ['node_modules', '.git']
}
})
Or in plugin options:
// webpack.config.js
import WebpackWindiCSSPlugin from 'windicss-webpack-plugin'
export default {
attributify: true
}
And use them as you would like:
<button
bg="blue-400 hover:blue-500 dark:blue-500 dark:hover:blue-600"
text="sm white"
font="mono light"
p="y-2 x-4"
border="2 rounded blue-200"
>
Button
</button>
Read the documentation for more details.
MIT License © 2021 Harlan Wilton
FAQs
windicss-webpack-plugin
The npm package windicss-webpack-plugin receives a total of 4,285 weekly downloads. As such, windicss-webpack-plugin popularity was classified as popular.
We found that windicss-webpack-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.