New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

umi-plugin-runtime-import

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

umi-plugin-runtime-import

dynamic import cdn modules when needed for umi

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

umi-plugin-runtime-import

NPM version NPM downloads

Dynamic import cdn modules when needed for umi.

Install

# or yarn add umi-plugin-runtime-import
$ npm install umi-plugin-runtime-import

Usage

Configure in .umirc.js or config/config.ts,

export default {
  runtimeImport: {
    base: 'https://gw.alipayobjects.com/os/lib/',
    js: {
      react: {
        moduleName: 'React',
        url: 'react/16.14.0/umd/react.development.js',
      },
      antd: {
        moduleName: 'antd',
        url: 'https://gw.alipayobjects.com/os/lib/antd/4.12.2/dist/antd.js',
      },
    },
    css: {
      'video.js/dist/video-js.min.css': 'video.js/7.6.6/dist/alt/video-js-cdn.min.css',
      'antd/dist/antd.css': {
        url: 'https://gw.alipayobjects.com/os/lib/antd/4.12.2/dist/antd.css',
      },
    },
  },
};

Development

Install dependencies,

$ yarn

Start the dev server,

$ yarn start

Inspired

https://github.com/aoi-umi/webpack-dynamic-import-cdn-plugin

FAQs

Package last updated on 17 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts