-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathvite.config.ts
More file actions
63 lines (59 loc) · 1.63 KB
/
vite.config.ts
File metadata and controls
63 lines (59 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { defineConfig } from 'vite';
import checker from 'vite-plugin-checker';
import directoryIndex from 'vite-plugin-directory-index';
import pkg from './package.json';
const banner_lines: string[] = [
'/*!',
' * ',
` * music21j version ${pkg.version} built on ${(new Date()).toISOString().split('T')[0]}.`,
` * Copyright (c) 2013-${(new Date()).getFullYear()} Michael Scott Asato Cuthbert`,
' * BSD License, see LICENSE',
' *',
' * https://github.com/cuthbertLab/music21j',
' * ',
' */',
'',
];
export default defineConfig({
build: {
outDir: 'build',
sourcemap: true,
emptyOutDir: true,
// this is the default.
// target: 'baseline-widely-available',
// esbuild.target is esnext for speed.
lib: {
entry: 'src/main.ts',
name: 'music21',
formats: ['umd', 'es'],
// "debug" is historical -- it is actually minified.
fileName: format => (format === 'umd') ? 'music21.debug.js' : 'music21.es.js',
},
rollupOptions: {
output: {
banner: banner_lines.join('\n'),
},
},
},
clearScreen: false,
esbuild: {
legalComments: 'inline',
},
plugins: [
checker({
typescript: true,
eslint: {
lintCommand: 'eslint src/',
useFlatConfig: true, // eslint 9+
},
}),
directoryIndex(),
],
// root defaults to process.cwd(), so no need:
// root: '.',
server: {
fs: {
strict: true,
},
},
});