Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
refactor(vite): switch asset copying plugin, remove unused javascript…
Browse files Browse the repository at this point in the history
… file (#265)

- Remove the unused `calcite-dist-build.js` file containing code for
setting up the Distribution build. Instead, link to the build
documentation, which has set up instructions.
- An example containing JavaScript files that use conflicting builds
will end up confusing some users.
- We want to keep these samples simple so they are easy to fork and
don't make CC look challenging to set up in various environments.
- Vite doesn't have any quirks with using the Distribution build so it
will work correctly if users follow the steps in our documentation.

- Switch to `vite-plugin-static-copy` from `rollup-plugin-copy` 

resolves #251
  • Loading branch information
benelan authored Oct 26, 2023
1 parent 77adb77 commit 6ca6ff8
Show file tree
Hide file tree
Showing 6 changed files with 470 additions and 813 deletions.
4 changes: 0 additions & 4 deletions vite/calcite-dist-build.js

This file was deleted.

27 changes: 11 additions & 16 deletions vite/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Calcite Vite</title>
<meta http-equiv="x-ua-compatible" content="ie=edge" />

<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<title>Calcite Components - Vite</title>
</head>

<script type="module" src="/main.js"></script>
<body>
<h1>
Hello, Vite <calcite-icon icon="banana"></calcite-icon>
Hello, Vite
<calcite-icon icon="banana"></calcite-icon>
</h1>

<calcite-date-picker range></calcite-date-picker>
<calcite-button>My button</calcite-button>



<!-- If using the distribution build, comment out the "main.js" file -->
<script type="module" src="/main.js"></script>

<!--
If using the distribution build, load the "calcite-dist-build.js" file to use Vite with auto-lazy loaded Calcite Components.
@link https://developers.arcgis.com/calcite-design-system/get-started/#distribution
-->
<!-- <script type="module" src="/calcite-dist-build.js"></script> -->
</body>
</html>
6 changes: 6 additions & 0 deletions vite/main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
/**
* This example uses the Custom Elements build of Calcite Components.
* Refer to the documentation if switching to the Distribution build:
* https://developers.arcgis.com/calcite-design-system/get-started/#choose-a-build
**/
import { setAssetPath } from '@esri/calcite-components/dist/components';
import '@esri/calcite-components/dist/components/calcite-button';
import '@esri/calcite-components/dist/components/calcite-icon';
import '@esri/calcite-components/dist/components/calcite-date-picker';
import '@esri/calcite-components/dist/components/calcite-loader';

import '@esri/calcite-components/dist/calcite/calcite.css';
import './style.css';

Expand Down
Loading

0 comments on commit 6ca6ff8

Please sign in to comment.