Skip to content

Instantly share code, notes, and snippets.

View gdonega's full-sized avatar
🐈

Gustavo Donegá Queiroz gdonega

🐈
  • Brasil, São Paulo
View GitHub Profile
@gdonega
gdonega / medium-criar-um-projeto-electron-vue-comandoAuditFix
Created April 6, 2020 02:28
Comando para corrigir com Audit do projeto
npm audit --fix
@gdonega
gdonega / medium-criar-um-projeto-electron-vue-RemovendoWarningsEErros713-index.js
Created April 6, 2020 02:23
Habilitando as ferramentas de desenvolvimento novamente
...
let mainWindow
const winURL = process.env.NODE_ENV === 'development'
? `http://localhost:9080`
: `file://${__dirname}/index.html`
function createWindow () {
/**
* Initial window options
*/
/**
* This file is used specifically and only for development. It installs
* `electron-debug` & `vue-devtools`. There shouldn't be any need to
* modify this file, but it can be used to extend your development
* environment.
*/
/* eslint-disable */
// Install `electron-debug` with `devtron`
...
function createWindow () {
/**
* Initial window options
*/
mainWindow = new BrowserWindow({
height: 563,
useContentSize: true,
width: 1000,
webPreferences: {
...
let mainConfig = {
entry: {
main: path.join(__dirname, '../src/main/index.js')
},
externals: [
...Object.keys(dependencies || {}),
{'electron-debug': 'electron-debug'}
],
module: {
@gdonega
gdonega / medium-criar-um-projeto-electron-vue-comandoAuditVisualizar
Created April 6, 2020 01:06
Comando para visualizar Audit do projeto
npm audit
@gdonega
gdonega / medium-criar-um-projeto-electron-vue-ArrumandoProjeto-index.js
Created April 6, 2020 00:48
Arrumando "./src/main/index.js" para a nova versão do Electron
'use strict'
import { app, BrowserWindow } from 'electron'
/**
* Set `__static` path to static files in production
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html
*/
if (process.env.NODE_ENV !== 'development') {
global.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
@gdonega
gdonega / medium-criar-um-projeto-electron-vue-ArrumandoProjeto-index.ejs
Last active April 6, 2020 00:55
Arrumando "./src/index.ejs" para a nova versão do Electron
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>meu-projeto-electron-vue</title>
<% if (htmlWebpackPlugin.options.nodeModules) { %>
<!-- Add `node_modules/` to global paths so `require` works properly in development -->
<script>
require('module').globalPaths.push('<%= htmlWebpackPlugin.options.nodeModules.replace(/\\/g, '\\\\') %>')
</script>
@gdonega
gdonega / medium-criar-um-projeto-electron-vue-ArrumandoProjeto-webpack.renderer.config.js
Created April 6, 2020 00:35
Arrumando ".electron-vue/webpack.renderer.config.js" para a nova versão do Electron
'use strict'
process.env.BABEL_ENV = 'renderer'
const path = require('path')
const { dependencies } = require('../package.json')
const webpack = require('webpack')
const MinifyPlugin = require("babel-minify-webpack-plugin")
const CopyWebpackPlugin = require('copy-webpack-plugin')
npm run dev