npm.io
2.70.4 • Published 5 months ago

@modern-js/plugin-module-import

Licence
MIT
Version
2.70.4
Deps
2
Size
5 kB
Vulns
0
Weekly
0
Stars
5.0K

@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.

Keywords