{"action":"created","issue":{"url":"https://api.github.com/repos/Romakita/ts-express-decorators/issues/455","repository_url":"https://api.github.com/repos/Romakita/ts-express-decorators","labels_url":"https://api.github.com/repos/Romakita/ts-express-decorators/issues/455/labels{/name}","comments_url":"https://api.github.com/repos/Romakita/ts-express-decorators/issues/455/comments","events_url":"https://api.github.com/repos/Romakita/ts-express-decorators/issues/455/events","html_url":"https://github.com/Romakita/ts-express-decorators/issues/455","id":358525172,"node_id":"MDU6SXNzdWUzNTg1MjUxNzI=","number":455,"title":"can I deploy my code using webpack","user":{"login":"dagda1","id":118328,"node_id":"MDQ6VXNlcjExODMyOA==","avatar_url":"https://avatars0.githubusercontent.com/u/118328?v=4","gravatar_id":"","url":"https://api.github.com/users/dagda1","html_url":"https://github.com/dagda1","followers_url":"https://api.github.com/users/dagda1/followers","following_url":"https://api.github.com/users/dagda1/following{/other_user}","gists_url":"https://api.github.com/users/dagda1/gists{/gist_id}","starred_url":"https://api.github.com/users/dagda1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagda1/subscriptions","organizations_url":"https://api.github.com/users/dagda1/orgs","repos_url":"https://api.github.com/users/dagda1/repos","events_url":"https://api.github.com/users/dagda1/events{/privacy}","received_events_url":"https://api.github.com/users/dagda1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-10T08:47:55Z","updated_at":"2018-09-19T09:48:29Z","closed_at":null,"author_association":"NONE","body":"## Informations\r\n\r\nType | Version\r\n---|---\r\nQuestion | 4.30.1\r\n\r\n****\r\n\r\n## Description\r\nI have a number of reasons why webpack is my preferred medium for deploying my node code.\r\n\r\nAt the moment, I define my server config like this:\r\n```\r\n@ServerSettings({\r\n  rootDir: path.resolve(__dirname),\r\n  acceptMimes: ['application/json'],\r\n  port: process.env.PORT,\r\n  mount: {\r\n    '/v1': '${rootDir}/controllers/**/*.ts'\r\n  },\r\n  exclude: ['**/*.test.ts'],\r\n  debug: true,\r\n  componentsScan: ['${rootDir}/services/**/**.*s', '${rootDir}/middleware/**/**.*s']\r\n})\r\n```\r\nI prefer to deploy my code to cloud foundry using webpack first to bundle the js because it will fix my relative path issues and any monorepo yarn workspace references, for example, I have the following code structure:\r\n\r\n```\r\n|_ common\r\n|_ api\r\n|_ frontend\r\n```\r\n\r\nBoth frontend and api share code in common, I have references like this:\r\n\r\n`import { PaymentType, PaymentPlan } from '../../../common/types/paymentType';`\r\n\r\nIf I use webpack, it will replace these relative references to point to the minified js file.  \r\n\r\nI also have mono repo references like:\r\n\r\n```\r\nimport { HttpStatusCode } from '@myspace/util';\r\n```\r\n\r\nI can use webpack [node externals](https://www.npmjs.com/package/webpack-node-externals) to reslove these references.\r\n\r\nI cannot do any of the above because of the way components are scanned and I have had to copy my monorepo code into the api code and I have to deploy:\r\n\r\n```\r\n|_ common\r\n|_ api\r\n```\r\n\r\nFor the relative path references to work.\r\n\r\nI love the project but this is a show stopper for me.\r\n\r\nIs there a way round this?"},"comment":{"url":"https://api.github.com/repos/Romakita/ts-express-decorators/issues/comments/422733245","html_url":"https://github.com/Romakita/ts-express-decorators/issues/455#issuecomment-422733245","issue_url":"https://api.github.com/repos/Romakita/ts-express-decorators/issues/455","id":422733245,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjczMzI0NQ==","user":{"login":"dagda1","id":118328,"node_id":"MDQ6VXNlcjExODMyOA==","avatar_url":"https://avatars0.githubusercontent.com/u/118328?v=4","gravatar_id":"","url":"https://api.github.com/users/dagda1","html_url":"https://github.com/dagda1","followers_url":"https://api.github.com/users/dagda1/followers","following_url":"https://api.github.com/users/dagda1/following{/other_user}","gists_url":"https://api.github.com/users/dagda1/gists{/gist_id}","starred_url":"https://api.github.com/users/dagda1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagda1/subscriptions","organizations_url":"https://api.github.com/users/dagda1/orgs","repos_url":"https://api.github.com/users/dagda1/repos","events_url":"https://api.github.com/users/dagda1/events{/privacy}","received_events_url":"https://api.github.com/users/dagda1/received_events","type":"User","site_admin":false},"created_at":"2018-09-19T09:48:29Z","updated_at":"2018-09-19T09:48:29Z","author_association":"NONE","body":"@Romakita  The problem is that in production there won't be any paths because there won't be any directories.\r\n\r\nI think the monorepo reason is a common enough reason as I don't want to deploy absolutely everything.\r\n\r\nWebpack will also flatten my relative paths meaning I don't have to deploy everything which I currently do.\r\n\r\nWould there be anyway to do this?  Can I set the componentScan to look at 1 file or must it be directories?\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"dagda1"}}