0.2.0 • Published 2 years ago

unplugin-parcel-css v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

0.2.0

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago