Skip to content

Commit

Permalink
build: switch to vite
Browse files Browse the repository at this point in the history
  • Loading branch information
lihbr committed Dec 19, 2022
1 parent feff198 commit 00dc6b6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ git commit -m "short description of your changes"

## Processes

Processes refer to tasks that you may need to perform while working on this project.
Processes refer to tasks that you may need to perform while working on this project.

### Developing

Expand Down Expand Up @@ -71,7 +71,7 @@ npm run dev

### Building

Our build system is handled by [siroc][siroc], a near-zero-config build tool powered by [esbuild](https://github.com/evanw/esbuild). It takes care of:
Our build system is handled by [Vite][vite]. Vite takes care of:

- Generating a [CommonJS (`.cjs`)](https://nodejs.org/docs/latest/api/modules.html#modules_modules_commonjs_modules) bundle and its source map;
- Generating an [ECMAScript (`.mjs`)](https://nodejs.org/docs/latest/api/modules.html#modules_modules_commonjs_modules) bundle and its source map;
Expand Down Expand Up @@ -362,7 +362,7 @@ This folder contains utility functions used to test the project.

This folder contains snapshots generated by the test framework when using snapshot testing strategies. It should not be altered manually.

### 📄  `.editorconfig`, `.eslintrc.cjs`, `.prettierrc`, `.size-limit.json`, `.versionrc`, `vitest.config.ts`, `siroc.config.ts`, `tsconfig.json`
### 📄  `.editorconfig`, `.eslintrc.cjs`, `.prettierrc`, `.size-limit.json`, `.versionrc`, `vite.config.ts`, `tsconfig.json`

These files contain configuration for their eponymous tools:

Expand All @@ -371,8 +371,8 @@ These files contain configuration for their eponymous tools:
- [Prettier][prettier];
- [Size Limit][size-limit];
- [Standard Version][standard-version];
- [Vite][vite];
- [Vitest][vitest];
- [`siroc`][siroc];
- [TypeScript][typescript].

Any change to those files are welcome but they should be first discussed on our [TypeScript template][template-issue]. Common sense still applies if the project requires some specific changes.
Expand Down Expand Up @@ -438,8 +438,8 @@ The minimum Node version supported by the project is stated under the `engines`
[prettier]: https://prettier.io
[size-limit]: https://github.com/ai/size-limit
[standard-version]: https://github.com/conventional-changelog/standard-version
[vitest]: https://vitest.dev/
[siroc]: https://github.com/unjs/siroc
[vite]: https://vitejs.dev
[vitest]: https://vitest.dev
[typescript]: https://www.typescriptlang.org
[template]: https://github.com/prismicio/prismic-typescript-template
[template-issue]: https://github.com/prismicio/prismic-typescript-template/issues/new/choose
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"src"
],
"scripts": {
"build": "siroc build",
"dev": "siroc build --watch",
"build": "vite build",
"dev": "vite build --watch",
"format": "prettier --write .",
"lint": "eslint --ext .js,.ts .",
"prepare": "npm run build",
Expand Down Expand Up @@ -61,6 +61,9 @@
"size-limit": "^8.1.0",
"standard-version": "^9.5.0",
"typescript": "^4.9.4",
"vite": "^4.0.2",
"vite-plugin-sdk": "^0.1.0",
"vitest": "^0.26.0"
},
"engines": {
"node": ">=12.7.0"
Expand Down
9 changes: 0 additions & 9 deletions siroc.config.ts

This file was deleted.

4 changes: 3 additions & 1 deletion vitest.config.ts → vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { defineConfig } from "vitest/config";
import { defineConfig } from "vite";
import sdk from "vite-plugin-sdk";

export default defineConfig({
plugins: [sdk()],
test: {
coverage: {
reporter: ["lcovonly", "text"],
Expand Down

0 comments on commit 00dc6b6

Please sign in to comment.