简体   繁体   English

如何构建反应组件 css

[英]How to build react components css

I developed a component using react, Use babel to build into the lib directory.我使用react开发了一个组件,使用babel构建到lib目录中。

But my css I do not know how to build it, I need help Thanks.但是我的 css 我不知道如何构建它,我需要帮助谢谢。

My Code:我的代码:

"scripts": { "build": "./node_modules/.bin/babel ./src --out-dir ./lib" } “脚本”:{“构建”:“./node_modules/.bin/babel ./src --out-dir ./lib”}

在此处输入图片说明

According to your code you need to have a file called index.scss in the same directory as the page in your screenshot.根据您的代码,您需要在与屏幕截图中的页面相同的目录中有一个名为 index.scss 的文件。 That would be a Sass file that compiles to CSS ( https://sass-lang.com ).那将是一个编译为 CSS ( https://sass-lang.com ) 的 Sass 文件。 If you are not using Sass, you need to replace the "required" file with whatever file you are using for your css (eg index.css).如果您没有使用 Sass,则需要将“必需”文件替换为用于 css 的任何文件(例如 index.css)。 I presume you are not asking how to use css itself in conjunction with your html.我想您不是在问如何将 css 本身与您的 html 结合使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM