Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benelan/cc-exports-map
Looking into adding an exports map to Calcite Components
https://github.com/benelan/cc-exports-map
calcite testing-repo
Last synced: 21 days ago
JSON representation
Looking into adding an exports map to Calcite Components
- Host: GitHub
- URL: https://github.com/benelan/cc-exports-map
- Owner: benelan
- Created: 2022-08-16T00:43:27.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-16T21:44:38.000Z (over 2 years ago)
- Last Synced: 2024-12-08T19:15:40.625Z (26 days ago)
- Topics: calcite, testing-repo
- Language: Svelte
- Homepage:
- Size: 532 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Calcite Components Exports Map
Looking into adding an [exports map](https://nodejs.org/api/packages.html#package-entry-points).
## Repro Steps
1. Run `npm install && npm run dev`
2. Open the browser and go to [http://localhost:5173/calcite](http://localhost:5173/calcite)
3. In the console you will see the same error as [this issue](https://github.com/Esri/calcite-components/issues/5077)
4. Exit the node process (`Ctrl+C`)
5. Run `npm run build:cc && npm run link && npm run dev`
6. Open the browser again to the same url
7. Notice a different error:
![image](https://user-images.githubusercontent.com/10986395/184781511-be962f83-adbe-40df-8dce-aeb0e87ffd18.png)The sample works if you use dynamic imports
```js
// src/routes/calcite.svelte
import { onMount } from 'svelte';
onMount(async () => {
import("@esri/calcite-components/dist/components").then(
({ setAssetPath }) =>
setAssetPath(
"https://unpkg.com/@esri/calcite-components/dist/calcite/assets"
)
);
import("@esri/calcite-components/dist/calcite/calcite.css");
import("@esri/calcite-components/dist/components/calcite-button.js");
});
```---
# create-svelte
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
## Creating a project
If you're seeing this, you've probably already done this step. Congrats!
```bash
# create a new project in the current directory
npm create svelte@latest# create a new project in my-app
npm create svelte@latest my-app
```## Developing
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```bash
npm run dev# or start the server and open the app in a new browser tab
npm run dev -- --open
```## Building
To create a production version of your app:
```bash
npm run build
```You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.