
Research
wget to Wipeout: Malicious Go Modules Fetch Destructive Payload
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
nuxt-lightningcss
Advanced tools
Use the built-in lightningcss preprocessor of Vite with Nuxt.
nuxt-lightningcss
dependency to your projectpnpm add -D nuxt-lightningcss
nuxt-lightningcss
to the modules
section of nuxt.config.ts
export default defineNuxtConfig({
modules: [
'nuxt-lightningcss'
]
})
lang="postcss"
in your style tags:<style lang="postcss">
.a {
color: black;
.b {
color: blue;
}
}
</style>
That's it! You can now use lightningcss in your Nuxt app ✨
To configure the module, add an options object either with the lightningcss
key or in the modules
array:
export default defineNuxtConfig({
modules: [
'nuxt-lightningcss'
],
lightningcss: {
// Options
}
})
export default defineNuxtConfig({
modules: [
['nuxt-lightningcss', {
// Options
}]
]
})
export interface ModuleOptions {
/**
* Paths to global stylesheets
* @default undefined
*/
globals?: string[] | undefined
/**
* Wether to minify stylesheets
* @default true
*/
minify: boolean
/**
* Lightningcss configuration file or object
* @default '~~/lightningcss.config.ts'
*/
config: string | Config
}
globals
: an array of stylesheet paths to import in all other stylesheets. This is especially useful when you want to transpile custom media queries.minify
: set to false to disable lightningcss minification (always disabled in development mode)config
: lightningcss configuration file or object. By default, the module will look for a lightningcss.config.ts
file in the root of your project.You can create a file to set lightningcss configuration:
// ~~/lightningcss.config.ts
import { defineLightningCSSConfig } from 'nuxt-lightningcss'
export default defineLightningCSSConfig({
// Lightningcss configuration
})
The lightningcss targets
option is automatically set from you project browserslist configuration (either in .browserslistrc
, browserslist
, package.json
or in the BROWSERSLIST
environment variable). If there isn't an explicit browserslist configuration in your project, the defaults
preset will be used. This can also be overridden from the lightningcss configuration:
import { defineLightningCSSConfig } from 'nuxt-lightningcss'
import { browserslistToTargets } from 'lightningcss'
import browserslist from 'browserslist'
export default defineLightningCSSConfig({
targets: browserslistToTargets(browserslist('> 0.5%, last 2 versions, Firefox ESR, not dead'))
})
Custom media queries can be transpiled using lightningcss, but since their actual definition is removed from the bundled stylesheets, they need to be imported in all stylesheets that use them. You can do that using the following configuration:
import { Features } from 'lightningcss'
export default defineNuxtConfig({
modules: [
'nuxt-lightningcss'
],
lightningcss: {
globals: [
// Import your custom media queries in all stylesheets
'~/assets/stylesheets/media-queries.css'
],
config: {
include: Features.CustomMediaQueries,
drafts: {
customMedia: true
}
}
}
})
By default, stylesheets are minified in production using lightningcss. You can disable minification using the following configuration (always disabled in development mode):
import { Features } from 'lightningcss'
export default defineNuxtConfig({
modules: [
'nuxt-lightningcss'
],
lightningcss: {
minify: false
}
})
# Install dependencies
pnpm install
# Generate type stubs
pnpm dev:prepare
# Develop with the playground
pnpm dev
# Build the playground
pnpm dev:build
# Run ESLint
pnpm lint
# Run Vitest
pnpm test
pnpm test:watch
# Release new version
pnpm release
v2.0.0
FAQs
Lightningcss for Nuxt
The npm package nuxt-lightningcss receives a total of 40 weekly downloads. As such, nuxt-lightningcss popularity was classified as not popular.
We found that nuxt-lightningcss demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.
Product
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.