diff --git a/packages/api/core/tmpl/_gitignore b/packages/api/core/tmpl/_gitignore index 9209ef5bfd..8e3a106692 100644 --- a/packages/api/core/tmpl/_gitignore +++ b/packages/api/core/tmpl/_gitignore @@ -1,2 +1,89 @@ -node_modules -out +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock +.DS_Store + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# Webpack +.webpack/ + +# Electron-Forge +out/ diff --git a/packages/api/core/tmpl/index.html b/packages/api/core/tmpl/index.html index e11c582a95..d4cb3586fa 100644 --- a/packages/api/core/tmpl/index.html +++ b/packages/api/core/tmpl/index.html @@ -1,10 +1,19 @@
- -Welcome to your Electron application.
diff --git a/packages/template/webpack/src/WebpackTemplate.ts b/packages/template/webpack/src/WebpackTemplate.ts index a57746571e..9df52204af 100644 --- a/packages/template/webpack/src/WebpackTemplate.ts +++ b/packages/template/webpack/src/WebpackTemplate.ts @@ -39,7 +39,6 @@ class WebpackTemplate implements ForgeTemplate { }); }); await asyncOra('Setting up webpack configuration', async () => { - await fs.appendFile(path.resolve(directory, '.gitignore'), '.webpack\n'); await fs.copy(path.resolve(__dirname, '..', 'tmpl', 'webpack.main.config.js'), path.resolve(directory, 'webpack.main.config.js')); await fs.copy(path.resolve(__dirname, '..', 'tmpl', 'webpack.renderer.config.js'), path.resolve(directory, 'webpack.renderer.config.js')); await fs.copy(path.resolve(__dirname, '..', 'tmpl', 'webpack.rules.js'), path.resolve(directory, 'webpack.rules.js')); diff --git a/packages/template/webpack/tmpl/renderer.js b/packages/template/webpack/tmpl/renderer.js index 6e7abde768..b1554f314a 100644 --- a/packages/template/webpack/tmpl/renderer.js +++ b/packages/template/webpack/tmpl/renderer.js @@ -1 +1,29 @@ -console.log('Heya, this is coming from a webpack bundle'); +/** + * This file will automatically be loaded by webpack and run in the "renderer" context. + * To learn more about the differences between the "main" and the "renderer" context in + * Electron, visit: + * + * https://electronjs.org/docs/tutorial/application-architecture#main-and-renderer-processes + * + * By default, Node.js integration in this file is disabled. When enabling Node.js integration + * in a renderer process, please be aware of potential security implications. You can read + * more about security risks here: + * + * https://electronjs.org/docs/tutorial/security + * + * To enable Node.js integration in this file, open up `main.js` and enable the `nodeIntegration` + * flag: + * + * ``` + * // Create the browser window. + * mainWindow = new BrowserWindow({ + * width: 800, + * height: 600, + * webPreferences: { + * nodeIntegration: true + * } + * }); + * ``` + */ + +console.log(`👋 This message is being logged by "renderer.js", included via webpack`);