Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding an exception for manifest.json when loading as json, fixes #558 #565

Closed
wants to merge 3 commits into from

Conversation

jvorcak
Copy link

@jvorcak jvorcak commented Sep 3, 2016

No description provided.

@ghost ghost added the CLA Signed label Sep 3, 2016
// A special case for manifest.json to place it into build root directory.
{
test: /\/manifest.json$/,
include: [paths.appSrc],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I’m not sure about is whether it should be in src. I’m leaning towards putting it on the top level because you can’t import it from code now—you’ll get a string. What do you think?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaearon sure, can you please explain why should it load differently from the top level in the code and differently from the template? I've tried some configurations and can't get it to load differently even though it's in the top level (by top level you mean template dir right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I wasn't clear. There is no way to make it load differently depending on context. Since we want it to resolve to filename, I wanted to move it away from src folder. The reason is that people normally expect that they can import JS/JSON inside src folder and treat it as a module. So it would be weird if src/manifest.json somehow was treated specially and you couldn't import it as a module from, for example, src/index.js. However we never officially supported importing modules from outside src folder so in this case special behavior seems like fair game. Does this make sense?

@jvorcak
Copy link
Author

jvorcak commented Sep 4, 2016

Can you please review @mxstbr @eanplatter?

@ghost ghost added the CLA Signed label Sep 4, 2016
@fson
Copy link
Contributor

fson commented Sep 10, 2016

I just read about the web app manifest and it turns out the standard file extension for it is .webmanifest, not .json. The .json file extension was considered at some point, but dropped from the standard later.

Considering this, I think it would be better to only support manifests using the .webmanifest file extension. This will encourage people to use the standard file extension, which makes it easier to serve the file using the correct application/manifest+json MIME type and will also get rid of the special case based on file name – we can handle all *.webmanifest files the same way using file-loader.

@gaearon
Copy link
Contributor

gaearon commented Sep 22, 2016

Sorry for the really long turnaround time. I was on a vacation, and couldn’t review it properly. In the end I decided to go with a different approach that also solves a dozen of other related issues: #703. I know it’s frustrating so I hope this doesn’t turn you off from future contributions. This was a really complicated issue because of all corner cases, and I think #703 is a better way to address it, but it took me a few weeks to figure out how to do it properly.

@gaearon gaearon closed this Sep 22, 2016
@jvorcak
Copy link
Author

jvorcak commented Sep 23, 2016

@gaearon no problem, I like that solution much much better as doing it this way was not general enough and not maintainable.

@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants