Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Added ability to load files relative to the app root #1217

Closed
wants to merge 2 commits into from

Conversation

rosieks
Copy link
Contributor

@rosieks rosieks commented Aug 22, 2017

Fix #1205

@SteveSandersonMS
Copy link
Member

Thanks for this, but could you clarify why you think we should make this change?

It looks like you're redefining ClientApp as the app root, rather than what is usually considered to be the app root, i.e., the directory containing the .csproj, Startup.cs, etc. That could also be confusing, because then there are effectively two app root directories, depending on what kind of technology you're talking about. If possible I'd prefer to keep the regular app root as being the only app root.

@rosieks
Copy link
Contributor Author

rosieks commented Aug 22, 2017

The main change is to add any root path in webpack configuration. Right now such root is no provided so when I add in any file such code import { reducer } from 'ClientApp/store'; Visual Studio and TypeScript will be satisfied because of "rootUrl": ".", but webpack doesn't know that and it fails during execution. For that reason I have added modules section in webpack.config.js. Detailed description on that change you can find here: http://moduscreate.com/es6-es2015-import-no-relative-path-webpack/

Regarding setting app root to ClientApi I did that because de facto it is the app root from JavaScript perspective. I'm not sure if somebody reference from it to something outside. The main purpose was to have shorter path. But I can be wrong and it can be changed. By the way there is already second app root - wwwroot, so this one is third.

@ghost ghost deleted a comment from dnfclas Nov 14, 2017
@ghost ghost removed the cla-already-signed label Nov 14, 2017
@SteveSandersonMS
Copy link
Member

SteveSandersonMS commented Nov 14, 2017

Thanks again for posting this.

In the next version of the ReactRedux template, the build mechanism comes entirely from create-react-app. There won't be a Webpack config file, so it would be impossible to apply this PR. As such, I'll mark this closed. Hope that's OK!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants