Doesn't work with ParcelJS
See original GitHub issueI’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:
- Created 5 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Parcel.js
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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 aindex.js
file where the entire API is exported from, so now you can finally do this:@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.