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 for images to move them to static folder #1825
Comments
pie6k
changed the title
Webpack Loader for images to move them to static folder
Webpack loader for images to move them to static folder
Apr 28, 2017
Currently this is not possible. |
kpdecker
added a commit
to healthline/next.js
that referenced
this issue
Jul 11, 2017
This has two fold impact: 1. Allows for arbitrary loaders to run in both node and browser environments (Fixes vercel#1825) 2. Optimizes the build time for modules. Risks: - Transitions all harmony code to utilize harmony end to end. Previously this had not happened, which may break users in unexpected ways. (See vercel#2508) - Require logic changed across the board to utilize node and webpack behaviors where possible, simplifying code, but potentially breaking things in the wild.
Any news on this? |
kpdecker
added a commit
to healthline/next.js
that referenced
this issue
Aug 19, 2017
This has two fold impact: 1. Allows for arbitrary loaders to run in both node and browser environments (Fixes vercel#1825) 2. Optimizes the build time for modules. Risks: - Transitions all harmony code to utilize harmony end to end. Previously this had not happened, which may break users in unexpected ways. (See vercel#2508) - Require logic changed across the board to utilize node and webpack behaviors where possible, simplifying code, but potentially breaking things in the wild.
kpdecker
added a commit
to healthline/next.js
that referenced
this issue
Oct 18, 2017
This has two fold impact: 1. Allows for arbitrary loaders to run in both node and browser environments (Fixes vercel#1825) 2. Optimizes the build time for modules. Risks: - Transitions all harmony code to utilize harmony end to end. Previously this had not happened, which may break users in unexpected ways. (See vercel#2508) - Require logic changed across the board to utilize node and webpack behaviors where possible, simplifying code, but potentially breaking things in the wild.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I want to be able to import images like:
import image from './image.png; // image variable should have static url
My loader looks like (
next.config.js
):Result is almost good.
Image file is inside
.next/static/images/image-ef89065b898bb1e3e802c62e4b264417.png
image
variable is/static/images/image-ef89065b898bb1e3e802c62e4b264417.png
, but when trying to load image withhttp://localhost:3000/static/images/image-ef89065b898bb1e3e802c62e4b264417.png
I get 404 error.Any ideas?
ps. I don't want to manually move files to
static
folder. I want images related to some component to be in the same folder as component itself`The text was updated successfully, but these errors were encountered: