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

webpack loader null #211

Closed
tleunen opened this issue Mar 25, 2016 · 3 comments
Closed

webpack loader null #211

tleunen opened this issue Mar 25, 2016 · 3 comments

Comments

@tleunen
Copy link
Contributor

tleunen commented Mar 25, 2016

A few extensions have a null loader, see https://github.com/gatsbyjs/gatsby/blob/master/lib/utils/webpack.config.js#L172-L195

Shouldn't it be file-loader by default, with loader: 'file'?

I'm saying that because I'm importing css, and inside my css, I have images. But because of the null loader, I'm getting this kind of things url([object Object]). Updating the loader to use the file loader instead fixes the issue and keep the path.

@KyleAMathews
Copy link
Contributor

#208 is the fix for this. Right now the all files inside /pages are required so I used the null-loader for a few file-types so that they could be "required" but not do anything. Once you can white-list which file types are pages, we won't have to ignore files which are being inadvertently being required.

@tleunen
Copy link
Contributor Author

tleunen commented Apr 6, 2016

uh @KyleAMathews.. I'm jumping on this again... In my initial issue, it's something inside a CSS, not a direct import.

Is it the same thing?
Because.. My pages are all markdown files. Inside the template, I'm importing a css, in which there's a url() for an image. And webpack tries to load that url with the null loader, which gives a url[[object Object]) in the output css.

I really think it's not right and gatsby shouldn't use a null loader by default, but the real loader for the file type.

@KyleAMathews
Copy link
Contributor

Agreed :-)

If you want to create a PR for fixing this plus #208 that'd be 💯

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

No branches or pull requests

2 participants