@@ -7,8 +7,14 @@ import { describe, test } from 'vitest';
7
7
describe ( 'build --watch command' , async ( ) => {
8
8
test ( 'basic' , async ( ) => {
9
9
const distPath = path . join ( __dirname , 'dist' ) ;
10
+ const dist1Path = path . join ( __dirname , 'dist-1' ) ;
10
11
fse . removeSync ( distPath ) ;
11
12
13
+ fse . removeSync ( dist1Path ) ;
14
+
15
+ const distEsmIndexFile = path . join ( __dirname , 'dist/esm/index.js' ) ;
16
+ const dist1EsmIndexFile = path . join ( __dirname , 'dist-1/esm/index.js' ) ;
17
+
12
18
const tempConfigFile = path . join ( __dirname , 'test-temp-rslib.config.mjs' ) ;
13
19
14
20
fse . outputFileSync (
@@ -26,24 +32,26 @@ export default defineConfig({
26
32
cwd : __dirname ,
27
33
} ) ;
28
34
29
- const distEsmIndexFile = path . join ( __dirname , 'dist/esm/index.js' ) ;
30
-
31
35
await awaitFileExists ( distEsmIndexFile ) ;
32
36
33
- fse . removeSync ( distPath ) ;
34
-
35
37
fse . outputFileSync (
36
38
tempConfigFile ,
37
39
`import { defineConfig } from '@rslib/core';
38
40
import { generateBundleEsmConfig } from 'test-helper';
39
41
40
42
export default defineConfig({
41
- lib: [generateBundleEsmConfig()],
43
+ lib: [generateBundleEsmConfig({
44
+ output: {
45
+ distPath: {
46
+ root: './dist-1/esm',
47
+ },
48
+ },
49
+ })],
42
50
});
43
51
` ,
44
52
) ;
45
53
46
- await awaitFileExists ( distEsmIndexFile ) ;
54
+ await awaitFileExists ( dist1EsmIndexFile ) ;
47
55
48
56
process . kill ( ) ;
49
57
} ) ;
0 commit comments