Category : parcel

I’d like to import HTML files as a string with ParcelJS, like this: import testHTML from ‘./testHTML.html’; document.body.insertAdjacentHTML(‘afterbegin’, testHTML); But the docs say: Importing HTML in JavaScript does not statically include the HTML strings, but the HTML files will dynamically be fetched using the Fetch API. Is there any way to force the import as ..

Read more

I’m trying to build out my portfolio with parcel and this error pops up. Only using HTML SCSS and JavaScript for all of my projects. I installed the plug in, didn’t think I needed babel but it still doesn’t work and gives me the same error. Pictures are attached https://i.postimg.cc/hPzvr4bn/Problem.png https://i.postimg.cc/MTLxMRLQ/Problem2.png Source: Ask Javascript..

Read more

I tried searching for the answer here but nothing worked. When I run my website, I press the start button and the question appears with multiple choice answers, when I try to click them I get Uncaught ReferenceError: checkAnswer is not defined even though i defined the function in my javascript file. I put an ..

Read more

So… I’m facing a unexpected behavior in my HTML. When i toggle some "href" to a "<a>" tag my bootstrap style just vanishes away. HTML: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Something</title> <link rel="stylesheet" href="./style/style.scss"> </head> <body> … <!–HERE–><li class="nav-li"><a class="nav-links" href="./index.html"><i class="fas fa-home"></i>Home</a></li> … <main data-router-wrapper> ..

Read more

I have this package.json (minimalist project here): { "name": "new-es6-project", "version": "1.0.0", "description": "A JavaScript project", "scripts": { "start": "npx parcel serve –log-level verbose ./src/index.html", "build": "npx parcel build ./src/index.html", "lint": "node ./node_modules/eslint/bin/eslint . –ext .js –fix" }, "targets": { "default": { "engines": { "browsers": "> 0.5%" }, "distDir": "dist", "publicUrl": "." } }, "repository": ..

Read more