@modern-js/plugin-module-import
TypeScript icon, indicating that this package has built-in type declarations

2.50.0 • Public • Published

@modern-js/plugin-module-import

The polyfill plugin of Modern.js Module.

A Library author don't want to "pollute" the global scope with the polyfills you are loading. This plugin injects imports to polyfills for unsupported features which are used in your code, without attaching the polyfills to the global scope but importing them as normal functions.

Note: It will not transform syntax by targets

Usage

import { defineConfig } from '@modern-js/module-tools';
import { modulePluginImport } from '@modern-js/plugin-module-import';

export default defineConfig({
  plugins: [modulePluginImport({
    pluginImport: [
      {
          libraryName: 'antd',
          style: 'css',
      },
    ],
  })],
});

Documentation

Contributing

Please read the Contributing Guide.

License

Modern.js is MIT licensed.

Package Sidebar

Install

npm i @modern-js/plugin-module-import

Weekly Downloads

772

Version

2.50.0

License

MIT

Unpacked Size

5.46 kB

Total Files

5

Last publish

Collaborators

  • jserfeng
  • jingkai.zhao
  • sanyuan0704
  • derozan
  • xieqixuan.xx
  • shawzhou
  • chenjiahan
  • xuchaobei
  • webinfrabot
  • targeral
  • yimingjfe
  • caohuilin
  • kky_kongjiacong
  • bytednpm