第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

【九月打卡】第21天 vite從入門到精通 4-7章

標簽:
征文 活動

课程名称: Vite 从入门到精通,玩转新时代前端构建法则

课程章节: 4-7 Rollup 常用插件盘点

课程讲师: Jokcy

课程内容:

rollup 常用插件盘点

  • commonjs

  • Babel

  • TypeScript

    //安装
    yarn add @rollup/plugin-typescript typescript tslib -D
    
    // 配置 rollup.config.js
    import ts from "@rollup/plugin-typescript";
    
    export default [
      {
        input: "index.js",
        external: ["react"],
        plugins: [
          ts(),
        ],
        output: [
          {
            file: "dist/index.es.js",
            format: "es",
            name: "Index",
            banner: "/** Hello This is Banner **/",
          },
        ],
      },
    ];
    
    // 使用 
    // testts.ts
    export function myTSFun(name: string) {
      console.log(name);
    }
    
    // index.js
    import { funA } from "a";
    // 引入 ts 文件
    import { myTSFun } from "./testts.ts";
    // 使用 ts 中函数
    myTSFun("name");
    
    funA();
    
    console.log("Hello Rollup12", React.Component, pkg);
    
    //打包
    npx rollup --config .\rollup.config.js
    
  • Replace

  • Node resolve

  • eslint

  • image

    //安装
    yarn add @rollup/plugin-image
    
    // 配置 rollup.config.js
    import image from "@rollup/plugin-image";
    
    export default [
      {
        input: "index.js",
        external: ["react"],
        plugins: [
          image(),
        ],
        output: [
          {
            file: "dist/index.es.js",
            format: "es",
            name: "Index",
            banner: "/** Hello This is Banner **/",
          },
        ],
      },
    ];
    
    // 使用
    // index.js
    import url from "./vuelogo.png";
    
    console.log(url);
    
    //打包
    npx rollup --config .\rollup.config.js
    
  • strip

    删除全局的 console.log

    //安装
    yarn add @rollup/plugin-strip
    
    // 配置 rollup.config.js
    import strip from "@rollup/plugin-strip";
    
    export default [
      {
        input: "index.js",
        external: ["react"],
        plugins: [
          strip(),
        ],
        output: [
          {
            file: "dist/index.es.js",
            format: "es",
            name: "Index",
            banner: "/** Hello This is Banner **/",
          },
        ],
      },
    ];
    
    //打包
    npx rollup --config .\rollup.config.js
    
  • wasm

课程收获:
知道一些常用的 rollup 插件,和使用
图片描述

點擊查看更多內(nèi)容
TA 點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評論
  • 收藏
  • 共同學習,寫下你的評論
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學

大額優(yōu)惠券免費領(lǐng)

立即參與 放棄機會
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

舉報

0/150
提交
取消