My goal is to release a UI library using React, but I am struggling with how to handle styles.
When I write code in a project, I typically use webpack and babel to build my code, resulting in the creation of a *.css file.
import React from 'react';
import './index.less';
export default function() {
return (
<div>
123
</div>
)
}
However, when I only focus on writing React components, I rely on babel to compile my code. This means that there is no css-loader to process *.less files. After compilation, even though there is `require('./index.less')` in the code, it cannot locate the file. If I still want to structure my code as shown above, how can I successfully publish these components with the necessary *.css files?