diff --git a/atom/browser/lib/init.coffee b/atom/browser/lib/init.coffee index 069eed8d1b53..1299364d2fa6 100644 --- a/atom/browser/lib/init.coffee +++ b/atom/browser/lib/init.coffee @@ -92,5 +92,8 @@ app.setAppPath packagePath # Load the chrome extension support. require './chrome-extension' +# Set main startup script of the app. +mainStartupScript = packageJson.main or 'index.js' + # Finally load app's main.js and transfer control to C++. -Module._load path.join(packagePath, packageJson.main), Module, true +Module._load path.join(packagePath, mainStartupScript), Module, true diff --git a/docs/tutorial/quick-start.md b/docs/tutorial/quick-start.md index 197cf0d3b32b..8fc696e0bcda 100644 --- a/docs/tutorial/quick-start.md +++ b/docs/tutorial/quick-start.md @@ -67,6 +67,9 @@ like this: } ``` +__Note__: If the `main` field is not present in `package.json`, Electron will +attempt to load an `index.js`. + The `main.js` should create windows and handle system events, a typical example being: