rollup-plugin-serve
rollup-plugin-serve copied to clipboard
Not actually serving two folders at the same time.
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"
}),
What is your folder structure?
If index.js is at dist/index.js, you might want:
<script src="/index.js"></script>
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.
Did you ever find a solution to this? I have a similar issue, the dist folder is returning 404
Did you ever find a solution to this? I have a similar issue, the dist folder is returning 404
Not that I remember.