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

[WIP] postcss, css-modules and file-loading/hashing in css #91

Closed
wants to merge 1 commit into from

Conversation

ChristopherBiscardi
Copy link
Contributor

This commit uses url-loader and img-loader to load images. They do
that because url() declarations in css files get translated into
require() calls.

for example, a call to

background-image: url('pages/0.jpg')

could get transformed to:

background-image:url(c5575182d7c7d7f98c8fc688bf840781.jpg)

Currently, the postcss, css-modules and file-loading works.


  • Use a solution for including the extracted styles.css. Ideally, that allows hashes for caches.
  • Split webpack processes are causing multiple images to be produced in a gatsby build. We should use webpack's multi-compiler mode to address this since that will mean we can refer to a single file rather than 1 file (which is the same file) per webpack process.

This commit uses url-loader and img-loader to load images. They do
that because `url()` declarations in css files get translated into
`require()` calls.

for example, a call to

```css
background-image: url('pages/0.jpg')
```

could get transformed to:

```css
background-image:url(c5575182d7c7d7f98c8fc688bf840781.jpg)
```
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

Successfully merging this pull request may close these issues.

1 participant