Closed thejetou closed 3 years ago
You need typescript to build the bot in a production environment though? Unless I'm misunderstanding something here, you wouldn't be able to clone and use this bot without installing typescript (and the other required types since it won't build without them).
You need typescript to build the bot in a production environment though? Unless I'm misunderstanding something here, you wouldn't be able to clone and use this bot without installing typescript (and the other required types since it won't build without them).
dependencies
should only contain modules what are required to run the bot, which is what "production" means in this case, rather than the production box.
dependencies
should only contain modules what are required to run the bot, which is what "production" means in this case, rather than the production box.
The problem is still that the bot won't currently start if --production
is passed to npm install
since typescript isn't installed. (Freshly clone copy of the repo w/ your package.json changes)
Since the startup file (bot
) calls tsc from node_modules/
#!/usr/bin/env node
console.log('Building...');
require('child_process').execSync(__dirname + '/node_modules/.bin/tsc', {stdio: 'inherit', cwd: __dirname});
console.log('Starting...');
require('module')._load('./dist/app.js', module, true);
Yes, you shouldn't be adding the --production
flag if you plan to build the bot yourself, which is why I removed it from README.md.
dependencies
should contain modules used in runtime;devDependencies
should contain modules used for developing the application.PostgresSQL falls under the former, while transpilers (such as tsc) and test frameworks (such as Jest) fall under the latter.
This can be seen in the official npm docs: https://docs.npmjs.com/files/package.json#dependencies where it says:
In the
devDependencies
of the same docs it states: