next js static build and download
local open html
error image
after next js static build, css js path starts with ‘file:///’
I want to change the path please
-- next.config.js
/** @type {import('next').NextConfig} */
const path = require('path');
const nextConfig = {
output: 'export',
reactStrictMode: false,
images: {
loader: "custom",
loaderFile: "localImageLoader.js"
},
webpack(config, options) {
config.resolve.modules.push(path.resolve("./"));
return config;
},
}
module.exports = nextConfig
I also tried assetprfix: “./” or basepath: “./”, but an error occurred because they did not start with /.
New contributor
서보경 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.