Skip to content

Small confusion in readme with respect to npm run build #51

@agboom

Description

@agboom

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions