-
Notifications
You must be signed in to change notification settings - Fork 219
Expand file tree
/
Copy pathvite.config.js
More file actions
24 lines (21 loc) · 776 Bytes
/
Copy pathvite.config.js
File metadata and controls
24 lines (21 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import path from 'path';
import fs from 'fs';
import { fileURLToPath } from 'url';
import { defineConfig } from 'rollup';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig(({ mode }) => {
return {
root: mode === 'production' ? path.resolve(__dirname, 'example') : path.resolve(__dirname, '../'),
base: '',
build: {
sourcemap: true,
outDir: path.resolve(__dirname, './example/bundle/'),
rollupOptions: {
input: fs
.readdirSync(path.resolve(__dirname, './example/'))
.filter(p => /\.html$/.test(p))
.map(p => path.resolve(__dirname, `./example/${ p }`)),
},
},
};
} );