Skip to content

Commit

Permalink
adopt vite
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Jul 26, 2024
1 parent 26b8d41 commit 04f06a0
Show file tree
Hide file tree
Showing 6 changed files with 520 additions and 2,636 deletions.
4 changes: 2 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ cd inputs
yarn
```

Inputs is written in ES modules and uses [Snowpack](https://snowpack.dev/) for development; this means that you can edit the Inputs source code and examples, and they’ll update live as you save changes. To start, copy over the example scratch.html file:
Inputs is written in ES modules and uses [Vite](https://vitejs.dev/) for development; this means that you can edit the Inputs source code and examples, and they’ll update live as you save changes. To start, copy over the example scratch.html file:

```
mkdir scratch
cp test/scratch.html scratch/index.html
```

Then start Snowpack:
Then start Vite:

```
yarn dev
Expand Down
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,28 @@
"test:lint": "eslint src test",
"prepublishOnly": "rm -rf dist && rollup -c && node bin/clean-css < src/style.css > dist/index.css",
"postpublish": "git push && git push --tags",
"dev": "snowpack dev"
"dev": "vite dev"
},
"_moduleAliases": {
"@observablehq/inputs": "./src/index.js"
},
"devDependencies": {
"@rollup/plugin-json": "4",
"@rollup/plugin-node-resolve": "13",
"@rollup/plugin-replace": "3",
"clean-css": "5",
"d3": "7",
"eslint": "8",
"js-beautify": "1",
"jsdom": "19",
"jsesc": "3",
"mocha": "9",
"rollup": "2",
"rollup-plugin-terser": "7",
"snowpack": "3"
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@rollup/plugin-replace": "^3.1.0",
"clean-css": "^5.3.3",
"d3": "^7.9.0",
"eslint": "^8.57.0",
"js-beautify": "^1.15.1",
"jsdom": "^24.1.1",
"jsesc": "^3.0.2",
"mocha": "^10.7.0",
"rollup": "^2.79.1",
"rollup-plugin-terser": "^7.0.2",
"vite": "^5.3.5"
},
"dependencies": {
"htl": "0.3",
"htl": "^0.3.1",
"isoformat": "^0.2.0"
},
"publishConfig": {
Expand Down
13 changes: 0 additions & 13 deletions snowpack.config.js

This file was deleted.

8 changes: 5 additions & 3 deletions test/scratch.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<meta charset="utf-8">
<style>

body {
Expand Down Expand Up @@ -214,8 +215,8 @@
<body class="observablehq">
<script type="module">

import "./src/style.css";
import * as Inputs from "../../src/index.js";
import "../src/style.css";
import * as Inputs from "../src/index.js";

document.body.appendChild(Inputs.range());
document.body.appendChild(Inputs.text({
Expand All @@ -228,3 +229,4 @@

</script>
</body>
</html>
3 changes: 3 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
root: "scratch"
};
Loading

0 comments on commit 04f06a0

Please sign in to comment.