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

Dumb Question: How to serve css files? #227

Closed
withinboredom opened this issue May 28, 2016 · 6 comments
Closed

Dumb Question: How to serve css files? #227

withinboredom opened this issue May 28, 2016 · 6 comments

Comments

@withinboredom
Copy link
Contributor

I put my built css files into assets/styles.css , however, when I try to load them from the client I get the 404 error: Cannot GET /assets/styles.min.css

Am I doing something wrong? Do I need something special in my routes file?

@doug-wade
Copy link
Collaborator

I get them by require-ing them: https://github.com/careylin/ui-kit/blob/master/www/index.js#L3

@withinboredom
Copy link
Contributor Author

🤦

@withinboredom
Copy link
Contributor Author

Uh oh:

ERROR in ./build/assets/fonts/glyphicons-halflings-regular.eot
website_1  | Module parse failed: /app/build/assets/fonts/glyphicons-halflings-regular.eot Line 1: Unexpected token ILLEGAL

Looks like a need a custom loader ... any tips to getting that to work?

@gigabo
Copy link
Contributor

gigabo commented May 29, 2016

Ooh... fonts...

We have a ticket open for custom loader support. But a new asset type might be easier have built-in support for, since the development asset servers will need to know about it. They live right in startServer.js for now.

Good issue @withinboredom!

@aickin
Copy link
Contributor

aickin commented May 30, 2016

@withinboredom Question: I'm assuming you just want to leave the URL in the CSS file, right? You aren't looking for any kind of inlining of the font, I presume.

I could imagine two paths:

  • Quick and dirty: just add a catch-all loader config with file-loader.
  • Comprehensive: add an extensible, configurable way to add custom loaders.

I'd vote for quick and dirty for now. Thoughts?

And FYI, I think the particular lines involved are at https://github.com/redfin/react-server/blob/master/packages/react-server-cli/src/compileClient.js#L130

@gigabo
Copy link
Contributor

gigabo commented May 31, 2016

@withinboredom - Closing this as "not a dumb question", and giving the web font issue that spawned from it a dedicated ticket: #233. Thanks. :)

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

4 participants