/** * Buildin plugin `@flatjs/babel-plugin-import` configurations */ export type ModularImportOption = { /** * @example `antd`, `lodash`, `material-ui`, `@flatjs`, `@dimjs`, `@fabric`, `@wine` */ libraryName: string; /** * Set this option to false if your module does not have a default export. * @default false */ transformToDefaultImport?: boolean; /** * @default: `esm` */ libraryDirectory?: string; /** * The value will append to `${libraryDirectory}/${transformedMethodName}/${fileName}` * e.g. `@scope/app/esm/{moduleName}/index` * @default "" */ fileName?: string; /** * We can use customName to customize import file path. * * If you want to use swc-loader, the return value must be a fixed string, dynamic results are not currently supported. * * @param transformedMethodName - The name of the method to be imported. * @param internalModulePath - The path of the module that is being imported. * e.g. `@dimjs/utils/dist/debounce/debounce.js` * * @example `import '@dimjs/lang/dist/is-empty.js';` */ customName?: (transformedMethodName: string, internalModulePath?: string) => string; /** * @default: true */ camel2DashComponentName?: boolean; /** * @default false * @example (name) => `${name}/style/2x` | `boolean` } * @deprecated Recommended to use the css in js solution */ style?: true | 'css' | ((name: string, file: Record) => string | boolean); };