0.3.2 • Published 5 years ago

umi-plugin-types v0.3.2

Weekly downloads
8
License
MIT
Repository
github
Last release
5 years ago

umi-plugin-types

Type definitions for umi plugin.

NPM version Build Status NPM downloads

Why

Installation

$ yarn add umi-plugin-types

Usage

import { IApi } from 'umi-plugin-types';

export default function(api: IApi) {
  api.log.success('hello');
}
import { IApi, IModifyHTMLWithASTFunc } from 'umi-plugin-types';

export default function(api: IApi) {
  const appendHead: IModifyHTMLWithASTFunc = ($, { route, getChunkPath }) => {
    $('head').append(`<script src="${getChunkPath('a.js')}"></script>`);
  };
  api.modifyHTMLWithAST(appendHead);
}

LICENSE

MIT