So I’m testing out Parceljs.
The dev mode is working perfectly. My file structure is dead simple, just for testing.
/src/index.html
/src/index.css
/src/index.js
and just to summarize the code:
index.html
<script src="./index.js" async defer></script>
<h1>Hello World!</h1>
<div id="app"></div>
index.css
body {
background-color: lightskyblue;
}
index.js
const div = document.getElementById("app");
div.textContent = `hey`;
package.json
{
"name": "parceltest1",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "parcel ./src/index.html",
"build": "parcel build ./src/index.html"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"parcel-bundler": "^1.12.4"
}
}
So like i said everything’s perfect on dev mode. But the build (prod & dev) in the /dist folder, when I run live server on the index.html. the css and the js codes aren’t working.