fass can return jsx/tsx, this middleware will translate it to html string as faas response
npm install @ncf/mw-react-server-render如果 faas 返回的是 react element 则使用 react-dom/server 渲染和转换成 html 文本
* 支持 react-helmet 在组件中配置 head 区域内容,包括 title, meta, style, link, style,可设置 html/body attributes
* 支持 import .css, .js as text 或者模板字符串函数
* 支持 css 到 less, css module
* 支持 .js 到 .ts
* 支持 这个涉及到异步组件,需要等待 css 加载完成后再渲染
* 支持
* css-in-js 方案到服务端应用的引用
- https://cssinjs.org/features?v=v10.9.2
1.
2. import csstext; ... , import jstext; ... 比较麻烦,还需要而外新起文件并且import比较麻烦
3. 直接用ts写客户端代码,ts转换后的js将出现在浏览器,完全优于方案1生成js