{"action":"created","issue":{"url":"https://api.github.com/repos/jaredpalmer/razzle/issues/714","repository_url":"https://api.github.com/repos/jaredpalmer/razzle","labels_url":"https://api.github.com/repos/jaredpalmer/razzle/issues/714/labels{/name}","comments_url":"https://api.github.com/repos/jaredpalmer/razzle/issues/714/comments","events_url":"https://api.github.com/repos/jaredpalmer/razzle/issues/714/events","html_url":"https://github.com/jaredpalmer/razzle/issues/714","id":345448113,"node_id":"MDU6SXNzdWUzNDU0NDgxMTM=","number":714,"title":"Override paths.js values in razzle.config.js","user":{"login":"KevinMind","id":19595165,"node_id":"MDQ6VXNlcjE5NTk1MTY1","avatar_url":"https://avatars0.githubusercontent.com/u/19595165?v=4","gravatar_id":"","url":"https://api.github.com/users/KevinMind","html_url":"https://github.com/KevinMind","followers_url":"https://api.github.com/users/KevinMind/followers","following_url":"https://api.github.com/users/KevinMind/following{/other_user}","gists_url":"https://api.github.com/users/KevinMind/gists{/gist_id}","starred_url":"https://api.github.com/users/KevinMind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KevinMind/subscriptions","organizations_url":"https://api.github.com/users/KevinMind/orgs","repos_url":"https://api.github.com/users/KevinMind/repos","events_url":"https://api.github.com/users/KevinMind/events{/privacy}","received_events_url":"https://api.github.com/users/KevinMind/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-28T13:23:18Z","updated_at":"2018-09-26T14:01:44Z","closed_at":null,"author_association":"NONE","body":"I would like to move my server dir into the root so my filesystem would look like this.\r\n\r\n-/src\r\n-server\r\n-...etc.\r\n\r\n\r\nDigging in razzle, it seems that babel and webpack are getting location of code from \r\n\r\n```\r\nmodule.exports = {\r\n  dotenv: resolveApp('.env'),\r\n  appPath: resolveApp('.'),\r\n  appBuild: resolveApp('build'),\r\n  appBuildPublic: resolveApp('build/public'),\r\n  appManifest: resolveApp('build/assets.json'),\r\n  appPublic: resolveApp('public'),\r\n  appNodeModules: resolveApp('node_modules'),\r\n  appSrc: resolveApp('src'),\r\n  appPackageJson: resolveApp('package.json'),\r\n  appServerIndexJs: resolveApp('src'),\r\n  appClientIndexJs: resolveApp('src/client'),\r\n  testsSetup: resolveApp('src/setupTests.js'),\r\n  appBabelRc: resolveApp('.babelrc'),\r\n  appEslintRc: resolveApp('.eslintrc'),\r\n  appRazzleConfig: resolveApp('razzle.config.js'),\r\n  nodePaths: nodePaths,\r\n  ownPath: resolveOwn('.'),\r\n  ownNodeModules: resolveOwn('node_modules'),\r\n  publicUrl: getPublicUrl(resolveApp('package.json')),\r\n  servedPath: getServedPath(resolveApp('package.json')),\r\n};\r\n```\r\n\r\nThe only issue is, because the values are hard coded, I can't override them.\r\n\r\nI've come up with a work around by copypasting the resolveApp function from razzle to razle.config.js\r\n\r\n```\r\nconst appDirectory = fs.realpathSync(process.cwd());\r\nconst resolveApp = relativePath => path.resolve(appDirectory, relativePath);\r\n\r\n```\r\nand looping through rules and depending on environment and configuration I replace the include property with my custom path, like so...\r\n\r\n```\r\n      appConfig.module.rules.map(rule => {\r\n        if (rule.include && rule.test) {\r\n          rule.include = [\r\n            resolveApp('server'),\r\n            resolveApp('src'),\r\n          ];\r\n        }\r\n      })\r\n```\r\n\r\nThis feels really hacky though. Would it be possible to abstract the hard coded values in paths.js to environment variables or expose them in the createConfig function so that I can change the paths whenever I want?\r\n\r\nI'd be happy to work on this if it seems like a good idea, but maybe there's a solution for this already that I'm missing. Please help :) "},"comment":{"url":"https://api.github.com/repos/jaredpalmer/razzle/issues/comments/424726720","html_url":"https://github.com/jaredpalmer/razzle/issues/714#issuecomment-424726720","issue_url":"https://api.github.com/repos/jaredpalmer/razzle/issues/714","id":424726720,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDcyNjcyMA==","user":{"login":"stale[bot]","id":26384082,"node_id":"MDM6Qm90MjYzODQwODI=","avatar_url":"https://avatars3.githubusercontent.com/in/1724?v=4","gravatar_id":"","url":"https://api.github.com/users/stale%5Bbot%5D","html_url":"https://github.com/apps/stale","followers_url":"https://api.github.com/users/stale%5Bbot%5D/followers","following_url":"https://api.github.com/users/stale%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/stale%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/stale%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stale%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/stale%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/stale%5Bbot%5D/repos","events_url":"https://api.github.com/users/stale%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/stale%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-09-26T14:01:44Z","updated_at":"2018-09-26T14:01:44Z","author_association":"NONE","body":"Hola! So here's the deal, between open source and my day job and life and what not, I have a lot to manage, so I use a GitHub bot to automate a few things here and there. This particular GitHub bot is going to mark this as stale because it has not had recent activity for a while. It will be closed if no further activity occurs in a few days. Do not take this personally--seriously--this is a completely automated action. If this is a mistake, just make a comment, DM me, send a carrier pidgeon, or a smoke signal. \n"}}
{"actor":{"display_login":"stale"}}