-
Notifications
You must be signed in to change notification settings - Fork 105
Description
For starters, this repo is a great way to get an Elm project started with Webpack, so kodus!
I've set up my own project with Elm using this starter pack successfully. However, when I run npm run build to create my production files and open index.html (like the readme says), the browser shows a blank page.
While investigating this, I noticed that the src path in the script tag in index.html has a leading slash (/), meaning it will look in the root directory of either the file system or the web server. Since "To check it, open dist/index.html" can also mean just opening the file in your browser (without a web server), this led to a little confusion on my part. I expected my Elm app to show up, but instead got a blank page and the browser suprisingly gave no errors. Removing the leading slash fixed this. Of course, when you deploy the dist directory to a web server, the added slash is logical.
Long story short: I wanted to point out this confusion in case anyone else ran into this. It might be a good idea to edit the readme so it mentions serving index.html on a web server explicitly. The line I'm talking about is right here: https://github.com/elm-community/elm-webpack-starter/blame/master/README.md#L52