-
Notifications
You must be signed in to change notification settings - Fork 2
/
xmigrate.ts
36 lines (35 loc) · 974 Bytes
/
xmigrate.ts
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
// import esbuild from 'esbuild';
import { MongoClient } from 'mongodb';
import { connect } from 'mongoose';
export default async () => {
return {
defaultTemplate: 'typescript',
outDir: './.xmigrate',
typescript: true,
builder: 'custom',
/* If bundler is not set default esbuild configuration will be added */
// bundler: {
// build(entryPoints: string[], outdir: string) {
// return esbuild.build({
// entryPoints,
// bundle: true,
// sourcemap: true,
// minify: false,
// platform: 'node',
// format: 'cjs',
// outdir,
// logLevel: 'info',
// });
// },
// },
// dateTimeFormat: () => new Date().toISOString(),
database: {
async connect() {
const url = 'mongodb://localhost:27017';
await connect(url);
const client = await MongoClient.connect(url);
return client;
},
},
};
};