0.0.4 • Published 5 years ago

jiailing-button v0.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

JalButton

十二、Rollup打包

1. Rollup

  • Rollup是一个模块打包器
  • Rollup支持Tree-Shaking
  • 打包的结果比Webpack要小
  • 开发框架/组件库的时候使用Rollup更合适

2. 安装依赖

  • rollup
  • rollup-plugin-terser
  • rollup-plugin-vue@5.1.9
  • Vue-template-compiler
yarn add rollup rollup-plugin-terser rollup-plugin-vue@5.1.9 vue-template-compiler -D -W

rollup.config.js

import { terser } from 'rollup-plugin-terser'
import vue from 'rollup-plugin-vue'
module.exports = [
  {
    input: 'index.js',
    output: [
      {
        file: 'dist/index.js',
        format: 'es'
      }
    ],
    plugins: [
      vue({
        css: true,
        compileTemplate: true
      }),
      terser()
    ]
  }
]
0.0.4

5 years ago

0.0.3

5 years ago