Change /_next/webpack url of webpack 'file-loader'
See original GitHub issueI’m using file loader like:
// handle images
config.module.rules.push({
test: /\.(ico|gif|png|jpg|jpeg|svg|webp)$/,
use: [
{
loader: 'emit-file-loader',
options: {
name: 'dist/[path][name].[ext]',
},
},
{
loader: 'file-loader',
options: {},
},
],
});
Later on, I import files like:
import img from './someImg.png'
Resulting URL is like: /_next/webpack/ef89065b898bb1e3e802c62e4b264417.png
and it works but it’s ugly 😃 Is it possible to customize it to make it more like /static/images/ef89065b898bb1e3e802c62e4b264417.png
etc
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Change /_next/webpack url of webpack 'file-loader' #1926
I'm using file loader like: // handle images config.module.rules.push({ test: ... Change /_next/webpack url of webpack 'file-loader' #1926.
Read more >file-loader - webpack - JS.ORG
The file-loader resolves import / require() on a file into a url and emits the file into the output directory. Getting Started. To...
Read more >Configure file-loader options with Webpack 5 for Next.js
According to Asset Modules instruction I should change file-loader into type: 'asset/resource' . I wonder how I can satisfy options used in file...
Read more >Next.js 5: Universal Webpack, CSS Imports, Plugins and Zones
From your perspective, all that changes is that an additional isServer property is passed to the decorator function above. However, the new ...
Read more >How to add webpack loader to Next.js application
Changing the wepback configuration. Next.js abstracts away from us the webpack configuration. They leave a way to tweak it in our project, but ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I fixed this problem in my nextjs starter. You can check the
next.config.js
file there. Any suggestion is welcomed btw.@pie6k @arunoda I made a PR to correct the prefix in production. https://github.com/zeit/next.js/pull/4072