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
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',
},
],
})],
});
Please read the Contributing Guide.
Modern.js is MIT licensed.