@@ -7,8 +7,14 @@ import { describe, test } from 'vitest';
77describe ( 'build --watch command' , async ( ) => {
88 test ( 'basic' , async ( ) => {
99 const distPath = path . join ( __dirname , 'dist' ) ;
10+ const dist1Path = path . join ( __dirname , 'dist-1' ) ;
1011 fse . removeSync ( distPath ) ;
1112
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+
1218 const tempConfigFile = path . join ( __dirname , 'test-temp-rslib.config.mjs' ) ;
1319
1420 fse . outputFileSync (
@@ -26,24 +32,26 @@ export default defineConfig({
2632 cwd : __dirname ,
2733 } ) ;
2834
29- const distEsmIndexFile = path . join ( __dirname , 'dist/esm/index.js' ) ;
30-
3135 await awaitFileExists ( distEsmIndexFile ) ;
3236
33- fse . removeSync ( distPath ) ;
34-
3537 fse . outputFileSync (
3638 tempConfigFile ,
3739 `import { defineConfig } from '@rslib/core';
3840import { generateBundleEsmConfig } from 'test-helper';
3941
4042export default defineConfig({
41- lib: [generateBundleEsmConfig()],
43+ lib: [generateBundleEsmConfig({
44+ output: {
45+ distPath: {
46+ root: './dist-1/esm',
47+ },
48+ },
49+ })],
4250});
4351 ` ,
4452 ) ;
4553
46- await awaitFileExists ( distEsmIndexFile ) ;
54+ await awaitFileExists ( dist1EsmIndexFile ) ;
4755
4856 process . kill ( ) ;
4957 } ) ;
0 commit comments