I am trying make a small webpage, and I am trying to program with modern javascript/html and css features, but the browser that this code is going to go on, is ultimately a very old browser where most of the features are not supported.
I am trying to use parceljs to transcibe the code into an older version, but even that code does not work, or at the very least, I cannot manage to setup parcel in such a way that the code works.
I have attempted to make a very small test project with an import statement that I know will fail:
"import {script} from './file/folder.js'; "
After running parcel, the code still fails. I have downloaded Chromium 53 to test with (Not chrome 53), and on that browser the code fails on an async method, which wasn't supposed on these browsers either.
I have tried to put a .browserslistrc file where my entry point is, where I have written various things such as "since 2010", "chrome 53" etc, and it fails everytime.
I am honestly unsure if parcel is even using the file. I am a beginner in web coding.
Is there anything specific I am overlooking?
If I contain this in my index.html file, and the script only changes color, it will wail on the import statement.
<script type="module">
import {colorChanger} from './assets/colorChanger.js';
const button = document.getElementById("button");
button.addEventListener("click", clickButton);
function clickButton()
{
colorChanger.changeColor();
}
</script>
After transcribing using parcel, and running the file:
It will then fail on the code below. Now this exists is in the transcibed code, and there are many more lines of code in this file.
ws.onmessage = async function(event /*: {data: string, ...} */ )