Skip to content

Commit

Permalink
Setup vite and vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
mikezaby committed Apr 29, 2024
1 parent 2c4d1c8 commit f7c4db0
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 8 deletions.
12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Blibliki</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "@blibliki/engine",
"version": "0.1.26",
"type": "module",
"source": "src/index.ts",
"main": "dist/main.cjs.js",
"module": "dist/main.esm.js",
"types": "dist/build/index.d.ts",
"main": "dist/index.umd.cjs",
"module": "dist/index.js",
"types": "dist/src/index.d.ts",
"files": [
"README.md",
"src",
Expand All @@ -17,11 +18,12 @@
"uuid": "^8.3.2"
},
"scripts": {
"start": "tsc -w -p tsconfig.json",
"build": "rollup -c",
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"lint": "eslint src",
"tsc": "tsc --noEmit",
"test": "jest"
"test": "vitest"
},
"devDependencies": {
"@types/crypto-js": "^4.2.2",
Expand Down
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("Hello from Blibliki");
1 change: 1 addition & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
2 changes: 1 addition & 1 deletion test/Module/Oscillator.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from "@jest/globals";
import { describe, it, expect } from "vitest";

import { Oscillator } from "../../src/modules";

Expand Down
2 changes: 1 addition & 1 deletion test/core/IO.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it, beforeEach } from "@jest/globals";
import { describe, it, expect, beforeEach } from "vitest";
import { MonoMocking, PolyMocking } from "../MockingModules";
import {
AudioInput,
Expand Down
25 changes: 25 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/// <reference types="vitest" />
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
import { resolve } from "path";

export default defineConfig({
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(__dirname, "src/index.ts"),
name: "Engine",
// the proper extensions will be added
fileName: "index",
},
},
test: {
include: ["test/**/*.{test,spec}.{ts,tsx}"],
browser: {
name: "chrome",
enabled: true,
headless: true,
},
},
plugins: [dts()],
});

0 comments on commit f7c4db0

Please sign in to comment.