소스 검색

Add example and notes on using require in renderer process

Jessica Lord 9 년 전
부모
커밋
1e287bdb62
2개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      index.html
  2. 2 0
      renderer.js

+ 5 - 0
index.html

@@ -11,4 +11,9 @@
     Chromium <script>document.write(process.versions.chrome)</script>,
     and Electron <script>document.write(process.versions.electron)</script>.
   </body>
+
+  <script>
+    // You can also require other files to run in this process
+    require('renderer.js')
+  </script>
 </html>

+ 2 - 0
renderer.js

@@ -0,0 +1,2 @@
+// This file is required by the index.html file and will
+// be executed in the renderer process for that window.