tonal build

This commit is contained in:
Felix Roos 2023-01-28 23:06:59 +01:00
parent fddbb2e2ac
commit 6118bd24f2
3 changed files with 28 additions and 1 deletions

View file

@ -3,10 +3,15 @@
"version": "0.5.0",
"description": "Tonal functions for strudel",
"main": "index.mjs",
"type": "module",
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs"
},
"scripts": {
"build": "vite build",
"test": "vitest run"
},
"type": "module",
"repository": {
"type": "git",
"url": "git+https://github.com/tidalcycles/strudel.git"
@ -31,6 +36,7 @@
"webmidi": "^3.0.21"
},
"devDependencies": {
"vite": "^3.2.2",
"vitest": "^0.25.7"
}
}

View file

@ -0,0 +1,19 @@
import { defineConfig } from 'vite';
import { dependencies } from './package.json';
import { resolve } from 'path';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [],
build: {
lib: {
entry: resolve(__dirname, 'index.mjs'),
formats: ['es', 'cjs'],
fileName: (ext) => ({ es: 'index.mjs', cjs: 'index.js' }[ext]),
},
rollupOptions: {
external: [...Object.keys(dependencies)],
},
target: 'esnext',
},
});