Introduction

VERSION NOTE

This is the documentation for Rollup Plugin Vue v4 and above. If you are upgrading from v2 or an earlier version, check out the Migration Guide. If you are using an older version, the old docs are here.

What does Rollup Plugin Vue do?

This is a plugin for rollup that allows you to author Vue components in a format called Single-File Components (SFCs). They look like this:

<template>
  <div class="example">{{ message }}</div>
</template>

<script>
export default {
  data () {
    return {
      message: 'Hello world!'
    }
  }
}
</script>

<style>
.example {
  color: red;
}
</style>

This plugin also enables:

  • scoped CSS
  • custom blocks
  • static assets references within <style> and <template>

And many other other features, maintaining parity with Vue Loader.

Why should I use Rollup over Webpack?

Rollup offers optimizations like tree shaking that make it ideal for building shared libraries. This plugin also prioritizes defaults that are ideal for most Vue plugins and UI component libraries.

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy