Last active
December 8, 2020 01:59
-
-
Save HallanCosta/448e6faea8cd8f92b6759a12c141d0f0 to your computer and use it in GitHub Desktop.
Deploy on heroku
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 - dentro de tsconfig.json tire o comentário da linha "outDir" e coloque o diretório como "./dist". | |
em seguida em "target" coloque "es2017" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 - Use o comando abaixo: | |
yarn add -D @babel/cli @babel/core @babel/node @babel/preset-env @babel/preset-typescript babel-plugin-module-resolver | |
2 - Crie um arquivo babel.config.js e cole: | |
module.exports = { | |
presets: [ | |
[ | |
'@babel/preset-env', | |
{ | |
targets: { | |
node: 'current' | |
} | |
} | |
], | |
'@babel/preset-typescript' | |
], | |
plugins: [ | |
['module-resolver', { | |
alias: {} | |
}] | |
], | |
ignore: [ | |
'**/*.spec.ts' | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 - Abra o package.json e crie os seguintes scripts | |
"scripts": { | |
"build": "babel src --extensions \".js,.ts\" --out-dir dist --copy-files --no-copy-ignored", | |
"start": "node dist/server.js", | |
"dev": "tsnd --transpile-only --respawn --ignore-watch node_modules src/server.ts" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 - Crie uma arquivo Procfile e cole dependendo de qual gerenciador de pacotes esteja utilizando. | |
web: npm start | |
ou | |
web: yarn start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 - dê um | git add . | em seguida um | git commit -m "Any Commit" |, depois dê um | git push heroku main | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 - terminado o deploy use | heroku logs --tail -a NOME_DA_URL_DEPLOYED | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment