unplugin-parcel-css
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

unplugin-parcel-css

NPM version

A Vite/webpack/Rollup/esbuild plugin with @parcel/css.

@parcel/css is

A CSS parser, transformer, and minifier written in Rust.

Usage

Vite

// vite.config.ts
import ParcelCSS from 'unplugin-parcel-css/vite';
export default defineConfig({
  plugins: [
    ParcelCSS({
      /* options */
    }),
  ],
});

Example: playground/

Rollup

// 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

// webpack.config.js
module.exports = {
  // ...
  plugins: [
    require('unplugin-parcel-css/webpack')({
      /* options */
    }),
  ],
};

You should use with css-loader.

Next.js

module.exports = {
  webpack: (config) => {
    config.plugins.push(
      require('unplugin-parcel-css/webpack')({
        /* options */
      })
    );
    return config;
  },
};

Nuxt

// nuxt.config.js
export default {
  buildModules: [
    [
      'unplugin-parcel-css/nuxt',
      {
        /* options */
      },
    ],
  ],
};

This module works for both Nuxt 2 and Nuxt Vite

Vue CLI

// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('unplugin-parcel-css/webpack')({
        /* options */
      }),
    ],
  },
};

Contribute

Welcome!

License

MIT

Package Sidebar

Install

npm i unplugin-parcel-css

Weekly Downloads

2

Version

0.2.0

License

MIT

Unpacked Size

18.9 kB

Total Files

28

Last publish

Collaborators

  • ssssota