简体   繁体   English

电子编译如何使用scss或至少css与反应?

[英]Electron-compile how to use scss or at least css with react?

I'd appreciate an example on how to work with scss or at least with css together with ReactJs and Electron-compile . 我很欣赏一个关于如何使用scss或者至少与css一起使用ReactJsElectron-compile ReactJs

Thanks! 谢谢!

electron-prebuilt-compile helps you with that. electron-prebuilt-compile可以帮助你。 From their own provided example : 他们自己提供的例子

<head>
  <link rel="stylesheet" type="text/less" href="main.less" />
</head>

<body id="host">
  <script type="application/javascript">
    import React from 'react';
    import ReactDOM from 'react-dom';
    import TodoApp from './components/TodoApp';

    ReactDOM.render(React.createComponent(TodoApp), document.getElementById('host'));
  </script>
</body>

If you want to use webpack you can have a look at electron-webpack which have add-ons to handle React, SASS, LESS, etc. 如果你想使用webpack,你可以看一下电子webpack ,它有附件来处理React,SASS,LESS等。

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

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