npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mlut/plugins

v1.0.2

Published

mlut plugins for Rollup, Vite and Webpack

Downloads

13

Readme

mlut plugins

The mlut plugins for Rollup, Vite and Webpack. Based on unplugin.

Installation

npm i -D @mlut/plugins sass-embedded

When using this package, you will need to install Sass separately. We recommend sass-embedded, but regular sass is also suitable.

This allows you to control the versions of all your dependencies, and to choose which Sass implementation to use.

Usage

Import the plugin for the appropriate bundler from the @mlut/plugins package as in one of the examples below. You can find more detailed examples using dev-server and livereload in the plugin tests directory

Rollup

// rollup.config.js
import { rollup } from '@mlut/plugins';

const mlut = rollup({
  output: 'dist/style.css',
  // other options...
});

export default {
  // rollup config...
  plugins: [mlut],
};

Vite

// vite.config.js
import { vite } from '@mlut/plugins';

const mlut = vite({
  output: 'dist/assets/style.css',
  // other options...
});

export default defineConfig(() => {
  return {
    // vite config...
    plugins: [mlut],
  }
});

Webpack

// webpack.config.js
import { webpack } from '@mlut/plugins';

const mlut = webpack({
  output: 'dist/style.css',
  // other options...
});

export default {
  // webpack config...
  plugins: [mlut],
};

Options

The plugin options are similar to the mlut CLI options

interface Options {
  output: string,
  input?: string,
  minify?: boolean,
  autoprefixer?: boolean,
  noMergeMq?: boolean,
}
  • output - output CSS file
  • input - input Sass file when you import mlut, configure it and write other CSS
  • minify - generate minified CSS. For this option to work, you need 1 of the following minifiers: csso, lightningcss, clean-css, cssnano or esbuild. You may already have it installed. When using lightningcss, you will also need to install browserslist
  • autoprefixer - whether to add vendor prefixes to CSS properties. You need the autoprefixer package or lightningcss for this option to work
  • noMergeMq - prevent merging of CSS media queries during minification. Relevant only when using the csso minifier

You can add the options in your input Sass file too. Options must be a valid JSON, but single quotes is allowed. Paths will be resolved relative to the JIT engine working directory

@use '@mlut/core' with (
  $jit: (
    'output': 'dist/assets/style.css',
    'minify': true,
    'autoprefixer': true
  ),
);

Documentation

Full documentation available here

License

MIT