Pavel 81153a3d98
Move to ESM, Vite, Vitest and Turborepo (#286)
* fix example hot module replacement

* add turbo

* migrate to vite

* use turbo for running scripts

* migrate testing to vitest

* set yarn in settings.json

* set noEmit in base tsconfig

* update yarn.lock

* move protos to src

* remove relative paths from status-js

* remove unused files

* update declaration dir

* use vite-node as a debugging runtime

* fix test

* unify tests

* fix test case typo
2022-06-28 16:40:39 +02:00

38 lines
735 B
TypeScript

/// <reference types="vitest" />
import { resolve } from 'node:path'
import { defineConfig } from 'vite'
import { dependencies } from './package.json'
const external = [
...Object.keys(dependencies || {}),
// ...Object.keys(peerDependencies || {}),
].map(name => new RegExp(`^${name}(/.*)?`))
export default defineConfig(({ command }) => {
return {
resolve: {
alias: {
'~': resolve('.'),
},
},
build: {
lib: {
entry: './src/index.ts',
fileName: 'index',
formats: ['es'],
},
target: 'es2020',
emptyOutDir: command === 'build',
rollupOptions: {
external,
},
},
test: {
// environment: 'happy-dom',
},
}
})