Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static dist doesn't work #3

Closed
TheChiefMeat opened this issue Oct 30, 2019 · 3 comments · Fixed by #30
Closed

Static dist doesn't work #3

TheChiefMeat opened this issue Oct 30, 2019 · 3 comments · Fixed by #30
Labels
bug Something isn't working

Comments

@TheChiefMeat
Copy link

Running the below command doesn't generate a working static version:

npm run dist

The generated index.html file has the below lines:

<link rel="stylesheet" href="/src.77de5100.css"></head>

and

<script src="/src.77de5100.js"></script>

the "/" before the src.77de5100.js isn't needed, and stops the javascript files from being loaded.

@huytd
Copy link
Owner

huytd commented Oct 30, 2019

Yes, this is a known issue when we build with parcel, you can't run it directly, but need to be run under a HTTP server.

It can be fixed by adding a --public-url into the command. Like this:

parcel build index.html --public-url .

I'll add the fix.

@huytd huytd added the bug Something isn't working label Oct 30, 2019
@Chouchen
Copy link

Chouchen commented Nov 4, 2019

Note that ./src.77de5100.js works too

@huytd
Copy link
Owner

huytd commented Nov 4, 2019

It should works now! 🍺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants