rollup-plugin-serve icon indicating copy to clipboard operation
rollup-plugin-serve copied to clipboard

Not actually serving two folders at the same time.

Open fenilli opened this issue 3 years ago • 4 comments

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"
}),

fenilli avatar Mar 28 '21 23:03 fenilli

What is your folder structure?

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

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

thgh avatar Apr 19 '21 14:04 thgh

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.

fenilli avatar Apr 19 '21 16:04 fenilli

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

latcha-lindseys avatar Nov 18 '21 18:11 latcha-lindseys

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

Not that I remember.

fenilli avatar Nov 18 '21 18:11 fenilli