Skip to content

Conversation

@DawnLck
Copy link

@DawnLck DawnLck commented Apr 1, 2022

补充了file参数,使得开发者能自己控制 style 文件的路径转化,如下

import customName from './customName';
export default defineConfig({
  library: {
    esm: 'babel',
    extraBabelPlugins: [
      [
        'babel-plugin-import',
        {
          libraryName: 'antd',
          libraryDirectory: 'es',
          style: true,
          customStyleName: (name: string, file: Record<string, any>, ...args: any) => { 
               // do something
          },
        },
      ],
    ],
  },
});

@afc163 afc163 requested a review from sorrycc April 1, 2022 03:17
@afc163
Copy link
Contributor

afc163 commented Apr 1, 2022

补个用例

@sorrycc sorrycc merged commit 469c018 into umijs:master Apr 11, 2022
zhanguangao pushed a commit to zhanguangao/babel-plugin-module-federation-import that referenced this pull request Sep 1, 2023
* feat(customStyleName): 完善customStyleName传参

* test(customStyleName): 提供customStyleName传入file参数的测例

* test(customStyleName): 补充customStyleName 的分支测例
This was referenced Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants