Skip to content

[Feature]: rspackExperiments.import redesign #12254

@ityuany

Description

@ityuany

What problem does this feature solve?

👍 Good

let transformConfig1 = [
  {
    filename: 'kebabCase',
    source: 'antd',
    output: ['antd/es/{{ filename }}.js', 'antd/css/{{ filename }}.css'],
    exclude: ['Provider', 'ConfigProvider'],
  },
  {
    filename: 'kebabCase',
    source: 'antd',
    output: ['antd/es/{{ filename }}.png', 'antd/es/{{ filename }}.svg'],
    include: ['Button'],
  },
];

example:

import { Modal } from "antd"

⬇️

import { Modal } from "antd/es/modal.js"
import { Modal } from "antd/css/modal.css"
import { Button } from "antd"

⬇️

import { Button } from "antd/es/button.js"
import { Button } from "antd/css/button.css"
import { Button } from "antd/css/button.png"
import { Button } from "antd/css/button.svg"

Bad 👎

let transformConfig2 = {
  libraryName: 'antd',
  libraryDirectory: 'es',
  cssDirectory: 'css',
  camelToDashComponentName: true,
  style: 'css',
};

What does the proposed API of configuration look like?

 {
    filename: 'kebabCase' ,  // "kebabCase" | "camelCase" | "snakeCase" | "pascalCase"
    source: 'antd',
    output: ['antd/es/{{ filename }}.js', 'antd/css/{{ filename }}.css'],
    exclude: ['Provider', 'ConfigProvider'],
    include: []   // supported '*'
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions