A Vite/webpack/Rollup/esbuild plugin with @parcel/css.
@parcel/css is
A CSS parser, transformer, and minifier written in Rust.
// vite.config.ts
import ParcelCSS from 'unplugin-parcel-css/vite';
export default defineConfig({
plugins: [
ParcelCSS({
/* options */
}),
],
});Example: playground/
// rollup.config.js
import ParcelCSS from 'unplugin-parcel-css/rollup';
export default {
plugins: [
ParcelCSS({
/* options */
}),
],
};You should use with css bundler like rollup-plugin-css-only.
// webpack.config.js
module.exports = {
// ...
plugins: [
require('unplugin-parcel-css/webpack')({
/* options */
}),
],
};You should use with css-loader.
module.exports = {
webpack: (config) => {
config.plugins.push(
require('unplugin-parcel-css/webpack')({
/* options */
})
);
return config;
},
};// nuxt.config.js
export default {
buildModules: [
[
'unplugin-parcel-css/nuxt',
{
/* options */
},
],
],
};This module works for both Nuxt 2 and Nuxt Vite
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-parcel-css/webpack')({
/* options */
}),
],
},
};Welcome!
MIT