Skip to content Skip to sidebar Skip to footer

Flask Can't Find Static Files With Webpack

I'm currently creating a project involving flask and webpack. Currently the flask server is able to find the revelant template, but is not able to find the relevant JavaScript. I

Solution 1:

The correct URL for app.bundle.js as per your configuration is /dist/app.bundle.js

If you want to serve static files from a different folder, you have to set the static_url_path parameter, in this case to "":

app = Flask(__name__, template_folder="dist", static_folder="dist", static_url_path="")


Reference: https://vilimpoc.org/blog/2012/11/21/serving-static-files-from-root-and-not-static-using-flask/

Post a Comment for "Flask Can't Find Static Files With Webpack"