Next.js Discord

Discord Forum

Build project without /_next/

Unanswered
Greyhound posted this in #help-forum
Open in Discord
GreyhoundOP
When i npm run build, then the static files path are as /_next/static/*
How can I build without /_next? so i only get in my index.html: /static/css/3cbd70ff48da2307.css

13 Replies

GreyhoundOP
bro that aint gonna fix anything
its still gonna have _next 💀
Rainbow trout
not possible then
why do you need this
GreyhoundOP
im trynna serve my .next project from flask
and the static files dont work because of the _next inside the paths defined
GreyhoundOP
app = Flask(__name__, static_url_path='/static/', static_folder='/opt/x/hello/code/webserver/templates/sla_frontend/.next/static/', template_folder='/opt/x/hello/code/webserver/templates')

PWD to .next project: "/opt/x/hello/code/webserver/templates/sla_frontend/.next"


So i can load in files from the URL: "http://sla123.2n.dk/static/chunks/603-afa7e6e066e7d5cb.js"

But when I build the project using npm run build then the paths are as defined "/_next/static/chunks/603-afa7e6e066e7d5cb.js"

I dont know how to change my directories and Flask init so that it can load the ones with _next at the start
@josh why do you need this
GreyhoundOP
heres a better overview of my problem 🙂
nvm LOL i just found out why..
omg
static_url_path is supposed to be _next/static
jessu