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

Static asset processing and optimization #867

Closed
ccorcos opened this issue Jan 24, 2017 · 13 comments
Closed

Static asset processing and optimization #867

ccorcos opened this issue Jan 24, 2017 · 13 comments

Comments

@ccorcos
Copy link

ccorcos commented Jan 24, 2017

any recommendations here? I usually use webpack with the image compression plugin, but it appears the standard approach is just to use file paths to the static directory. if I wanted to optimize my image assets, how do you recommend I do that without overwriting the full resolution images?

@arunoda arunoda changed the title atatic asset processing and optimization satatic asset processing and optimization Jan 24, 2017
@arunoda arunoda changed the title satatic asset processing and optimization Static asset processing and optimization Jan 24, 2017
@arunoda
Copy link
Contributor

arunoda commented Jan 24, 2017

Currently, we don't have a built in way to do it.
But you need to do it manually for the static assets in your app.

Also the best way is to move all static content into a CDN. We track that here: #737

@timneutkens
Copy link
Member

@arunoda might be an interesting feature though

@ccorcos
Copy link
Author

ccorcos commented Jan 25, 2017 via email

@arunoda
Copy link
Contributor

arunoda commented Jan 25, 2017

@ccorcos It's true if that's only a client side app.
But since we do SSR stuff, we can't do everything in node which can be done with Webpack.

@ccorcos
Copy link
Author

ccorcos commented Jan 25, 2017 via email

@arunoda
Copy link
Contributor

arunoda commented Jan 26, 2017

Yes we do. That part is fine. But then we need to run those files on the server. Running that exactly on the server is impossible (and cost us with perf). So, we run it without webpack on the server for SSR.

That's why we can't simply use everything webpack support.

@ccorcos
Copy link
Author

ccorcos commented Feb 6, 2017

Ah, so on the server, you're just using babel plugins but in the browser, you're loading a bundle from webpack... That makes sense.

Although what's wrong with running the webpack build on the server? You can set Node.js as a build target.

Then we'd be able to create custom chunks and dynamically async load them inside getInitialProps...

@arunoda
Copy link
Contributor

arunoda commented Feb 7, 2017

@ccorcos Even it's Node.js target it takes time and compile time(CPU). We don't need that.
We've a much efficient and speed setup.

@ccorcos
Copy link
Author

ccorcos commented Feb 7, 2017

Well you can compile only once before you deploy...

@arunoda
Copy link
Contributor

arunoda commented Feb 7, 2017

@ccorcos What about dev time build and about dynamic pages. We need to work on that stuff too.
Anyway, we are not considering on going this approach at this time. (At least for 2.0)

@ccorcos
Copy link
Author

ccorcos commented Feb 7, 2017

What about dev time build

You can leave out the image processing plugin

What about... about dynamic pages

Well the pages are still built and split with webpack statically though right?

@ccorcos
Copy link
Author

ccorcos commented Feb 7, 2017

I'm just failing to understand what exactly is the limitation here.

@sedubois
Copy link
Contributor

sedubois commented Feb 7, 2017

It might make sense to open a new issue to discuss the topic of "universal webpack". Sounds like it would have the potential to fix several limitations and reduce code complexities coming from the differences between server and client side.

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants