Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't work with ParcelJS

See original GitHub issue

I’m trying to use this in a project I build with parcel and parcel-svelte-plugin. Unfortunately due to the way parcel automatically determines how to parse files, the parcel-svelte-plugin relies on .svelte file extensions for components, hence:

import NavLink from 'svelte-routing/NavLink.html';
import Route from 'svelte-routing/Route.html';

won’t work, as the html files will be treated as plain html.

Is there a reason that NavLink and Route are exported like this? Could they instead be exports?

import { NavLink, Route } from 'svelte-routing'

Thanks, Antony

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

EmilTholincommented, May 9, 2019

Sorry for keeping you waiting for so long. With the release of 1.0.0 we changed to the .svelte file extension, and we also added a index.js file where the entire API is exported from, so now you can finally do this:

import { Router, Route, Link } from "svelte-routing";
antonycommented, Nov 21, 2018

@konsumer yes - as per my original comment, this will fix it.

There is a concept of a ‘svelte’ export already @EmilTholin - simply specify the ‘svelte’ attribute on package.json and export a js file which in turn exports your components. Rollup and Webpack will use this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No problem. Parcel works out of the box just as you'd expect. Parcel supports many languages and file types out of the box,...
Read more >
Parcel build command not working
I am following the basic tutorial for Parcel to bundle js, css and image files. My file structure dist node_modules src - index.html...
Read more >
Issues · parcel-bundler/parcel
Issues list. @parcel/bundler-default: The expression evaluated to a falsy value (CSS modules and non-modules) Bug Bundler.
Read more >
How to Bundle a Web App with Parcel.js
A bundler is a tool used to solve this latency issue by combining and merging your code into a single file. This limits...
Read more >
Parcel JS Setups Walkthrough and Review - YouTube
Parcel is a popular JavaScript bundling tool that can commonly be compared to Webpack, Rollup, and other JS bundlers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found