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

Not actually serving two folders at the same time. #74

Open
fenilli opened this issue Mar 28, 2021 · 4 comments
Open

Not actually serving two folders at the same time. #74

fenilli opened this issue Mar 28, 2021 · 4 comments

Comments

@fenilli
Copy link

fenilli commented Mar 28, 2021

Tried this code, and it works fine for the static file, it reads my index.html and serves it, but my dist folder is never served.

<!-- Servers correctly inside localhost:8080 -->
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf8" />
    <meta name="viewport" content="width=device-width" />

    <title>Button Sandbox</title>
</head>

<body>
    <!-- Always fails saying it cant find ./dist/index.js, looking inside chrome sources, there is index.html but no dist folder -->
    <script src="./dist/index.js"></script>
</body>

</html>
!production && serve({
	contentBase: ["dist", "static"],
	port: "8080"
}),
@thgh
Copy link
Owner

thgh commented Apr 19, 2021

What is your folder structure?

If index.js is at dist/index.js, you might want:

    <script src="/index.js"></script>

@fenilli
Copy link
Author

fenilli commented Apr 19, 2021

The folder structure was:

dist
- index.js
static
- index.html

meaning that dist is outside static, its another folder, I will try looking as root instead.

@latcha-lindseys
Copy link

Did you ever find a solution to this? I have a similar issue, the dist folder is returning 404

@fenilli
Copy link
Author

fenilli commented Nov 18, 2021

Did you ever find a solution to this? I have a similar issue, the dist folder is returning 404

Not that I remember.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants