Open frederikhors opened 5 years ago
I'm having troubles using the default start script in package.json.
start
package.json
The default one is:
"start": "owc-dev-server --open ./src"
but I'm building a SPA (single page application) and I changed it to:
"start": "owc-dev-server --app-index ./src/index.html"
adding also in index.html's <head>:
index.html
<head>
<base href="/">
But now the problem is:
<script type="module" src="./my-app.js"></script>
In browser's console I got this error:
Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
I need to change it like this to work:
<script type="module" src="./src/my-app.js"></script>
adding ./src before /my-app.js.
./src
/my-app.js
The problem now is using npm run build: it doesn't find my-app.js during build.
npm run build
my-app.js
I'm wrong somewhere, but where?
I'm having troubles using the default
start
script inpackage.json
.The default one is:
but I'm building a SPA (single page application) and I changed it to:
adding also in
index.html
's<head>
:But now the problem is:
In browser's console I got this error:
I need to change it like this to work:
adding
./src
before/my-app.js
.The problem now is using
npm run build
: it doesn't findmy-app.js
during build.I'm wrong somewhere, but where?