I have a service worker that comes from my js/index.js:
import '../scss/app.scss';
// Detect if service workers enabled
if ('serviceWorker' in navigator) {
try {
navigator.serviceWorker.register('../sw.js');
console.log('Service Worker…
I would like to dynamically load some components and am getting an error when executing the import() function. The import fails because it cannot find the file.
Does anyone know how I can do this in ParcelJS?
Error:
Uncaught (in promise)…
I previously setup Gulp to use Sass, Pug and Babel. The fonts loaded fine. I switched to using Parcel now and it's working as expected, except one thing. The fonts arent loading in.
Here is the entirety of _fonts.sass:
@font-face
font-family:…
Plain vanilla typescript dev environment set up with parcel.
I don't have SourceMap in browser (Edge/Chrome):
DevTools failed to load SourceMap: Could not parse content for http://localhost:1234/index.7cacc1f4.js.map: Unexpected token < in JSON at…
This is the first time I am using ParcelJS. I npm it following their instruction everything looks good. So it would be the latest version. As soon as I run it against my project (a .html file with some js and css attached to it), I get this…
Is there an easy way to insert my scss file into my template.innerHTML?
The purpose being encapsulation of this specific style to be effective only for this component.
I am using "parcel-bundler": "^1.12.4"
How can I import the scss without it…
I first thought this would be trivial, but after digging into it, I can't find a way to do this. Is this impossible?
For example, I would like to take any node.js package and compile it like this:
import { method } from "SomeLibrary";
export const…
I'm making a project with parcel and typescript. It works great, but for one library I'm using, I would need to host a bunch of .json-files at a fixed directory:
The files look as following:
index.html
index.ts
tiles/
| file.json
| file0.json
|…
When I compile code with parcel using the command parcel src/index.html its just generate all files inside dist folder, like this image below. But I need a decorated way to manage files after complete my website. I mean I need img folder for all the…
I am using ParcelJS as a module bundler and for some reasons I am using JS variables in the HTML which are later to be read by JS code.
In my HTML:
In my…
I am using Parcel JS for a personal project and I am really confused by this option:
--public-url
Here is the documentation: https://en.parceljs.org/cli.html#options
which is really scarce.
1) What is the main use of it?
2) It says that it is…
I am using Parcel with SASS, and I am trying to use the material-components-web
(MDC Web).
In the guide of MDC Web they say you should import the modules that come with this package like this inside your stylesheets:
@import…
I'm using imports with absolute paths in my Parcel project but these absolute paths aren't equally resolved by Cypress tests.
Difference in module resolution
Parcel: import {foo} from '/foo.js': relatively to project root
Cypress: import {foo} from…
I need to run my ReactJS application on the port 1234 but when I run yarn dev, I get the following:
$ parcel src/index.html --port 1234
Server running at http://localhost:2493 - configured port 1234 could not be used.
√ Built in 11.45s.
It…
Is it possible to bundle external resources linked with absolute URLs to the dist folder with Parcel?
This bundles and hashes fine
to
What i'd like to do