-
Notifications
You must be signed in to change notification settings - Fork 1
/
modern.config.ts
44 lines (43 loc) · 994 Bytes
/
modern.config.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
37
38
39
40
41
42
43
44
import { moduleTools, defineConfig } from '@modern-js/module-tools';
import { testingPlugin } from '@modern-js/plugin-testing';
import path from 'node:path';
export default defineConfig({
plugins: [moduleTools(), testingPlugin()],
buildConfig: [
{
format: 'cjs',
target: 'es2021',
buildType: 'bundle',
outDir: './dist',
esbuildOptions: options => {
options.outExtension = { '.js': '.cjs' };
return options;
},
dts: false,
},
{
format: 'esm',
target: 'es2021',
buildType: 'bundle',
outDir: './dist',
esbuildOptions: options => {
options.outExtension = { '.js': '.mjs' };
return options;
},
dts: false,
},
{
buildType: 'bundle',
outDir: './dist',
dts: {
only: true,
},
},
],
testing: {
jest(config) {
config.setupFiles = [path.join(__dirname, 'tests/jest.setup.js')];
return config;
},
},
});