Reactjs 如何将样式导出到npm类型脚本库?

Reactjs 如何将样式导出到npm类型脚本库?,reactjs,fontello,Reactjs,Fontello,我已经创建了一个使用typescript和redux的自定义react库 我做的第一件事是创建一个名为react tree的项目,它是用react开发的,我使用了typescript和redux。此外,我还创建了一个样式文件夹,在图标文件夹中添加了fontello,如图所示 然后我创建了一个项目,我称之为react tree library来发布,这两个项目都能完美地工作 我遇到的问题是,在库(react tree libart)中没有导出样式 当我在react树中执行npm运行build时,会

我已经创建了一个使用typescript和redux的自定义react库

我做的第一件事是创建一个名为react tree的项目,它是用react开发的,我使用了typescript和redux。此外,我还创建了一个样式文件夹,在图标文件夹中添加了fontello,如图所示

然后我创建了一个项目,我称之为react tree library来发布,这两个项目都能完美地工作

我遇到的问题是,在库(react tree libart)中没有导出样式

当我在react树中执行
npm运行build
时,会生成一个build文件夹,其中/build/static/media是fontello字体、图像

来自反应树的脚本

“构建”:“fontello cli安装--config./src/styles/components/icons/config.json--css./src/styles/components/icons/css--font./src/styles/components/icons/font&&react脚本构建”

但是,当我在react树库中执行
npm运行build
时,会生成两个文件夹:build文件夹和dist文件夹

来自反应树库的脚本

“脚本”:{ “fontello”:“fontello cli安装--config./src/tree/styles/components/icons/config.json--css./src/tree/styles/components/icons/css--font./src/tree/styles/components/icons/font&&react脚本构建”, “构建”:“npm运行方泰洛和tsc” },

这是因为我正在调用
react scripts build
tsc
,我知道这是错误的

但这是我的问题,我如何在dist文件夹中生成样式以发布带有样式的库

这是我的tsconfig.json

{
  "compilerOptions": {
      "target": "es5",
      "module": "commonjs",
      "declaration": true,
      "declarationMap": true,
      "sourceMap": true,
      "jsx": "react",
      "strict": true,
      "outDir": "./dist",
      "esModuleInterop": true,
  },
  "include": ["src"]
}
下面是我的项目图片: