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

rollup-plugin-vuetify

v0.2.4

Published

A-la-carte (treeshaking) for you vuetify

Downloads

961

Readme

rollup-plugin-vuetify

The plugin is a missing autoloader of vuetify components.

It eliminates the pain of manually importing all of the Vuetify components you use. It also allows you to use tree shaking as efficiently as possible.

This is a must if you decide to write your vuetify-based library.

Installation

Install the plugin with npm:

npm install --save-dev vue-template-compiler rollup-plugin-vuetify 

Note: vue-template-compiler version must match your vue version

Configuration

There is a configuration example for building a simple js library:

const { rollup } = require("rollup");
const vue = require("rollup-plugin-vue");
const postcss = require("rollup-plugin-postcss");
const vuetify = require("rollup-plugin-vuetify");

const build = async () => {
  try {
    const bundle = await rollup({
      input: "src/index.js",
      external: ["vue", "vuetify/lib"],
      plugins: [postcss(), vue(), vuetify()],
    });

    bundle.write({
      format: "esm",
      file: "dist/bundle.js",
    });
  } catch (e) {
    console.error(e);
  }
};

build();

You can also find the typescript example here demo/rollup.js

Demo

The demo/ folder and html preview were created as an example of how a project can be configured and what types of components can be used.

├── dist
│   ├── browser.js                      <- fully compiled application without vue but with vuetify
│   ├── index.html                      <- demo with application to show that everything is ok
│   ├── ts.js                           <- bundled components with @rollup/plugin-typescript
│   └── ts2.js                          <- bundled components with rollup-typescript-2
├── rollup.js                           <- rollup configuration
├── src
│   ├── App.vue                         <- application component
│   ├── Components                      <- components with all possible scenarios
│   │   ├── Complex.vue                 <- component with partial manual import
│   │   ├── Decorated.vue               <- component decorated with `vue-property-decorator`
│   │   ├── Empty.vue                   <- component without any properties, can be used as a wrapper
│   │   ├── EmptyDecorator.vue          <- component with "empty" decorator
│   │   ├── ExportByReference.vue       <- component with export defined previously as a variable
│   │   ├── Extended.vue                <- component created with Vue.extend()
│   │   ├── External                    <- component splitted into separate files
│   │   │   ├── Component.vue
│   │   │   ├── index.js
│   │   │   ├── script.js
│   │   │   ├── style.css
│   │   │   └── template.html
│   │   ├── Simple.vue                  <- simple generic component
│   │   ├── WithEmptyScript.vue         <- component with empty `script` section
│   │   ├── WithoutScript.vue           <- component without `script` section, best choice for template chunks
│   │   └── index.js
│   ├── index.js                        <- entry point to bundle components as es module without vue and vuetify
│   ├── main.js                         <- entry point of application
│   └── shims-vue.d.ts
└── tsconfig.json

Supported Feartures

  • Typescript >2.x and vue-property-decorator (docs);
  • Components created with Vue.extend() (docs);
  • Components separated on the external files (docs, example);
  • Autoloading of Vuetify 1.x and 2.x components;
  • Partial import. All missing components will be added to the final bundle. This option is great for existing projects;

Known Caveats

Under The Hood

It works similarly to the vuetify-loader. But plugin uses AST transformation under the hood. It allows you to get rid of extra code and optimize your final bundle even more.