Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ node_modules/
.eslintcache

dist/
dist-types/
dist-*/
compiled/
coverage/
doc_build/
Expand All @@ -22,4 +22,4 @@ test-results
.idea/
.nx/
**/@mf-types
**/@mf-types/**
**/@mf-types/**
20 changes: 14 additions & 6 deletions tests/integration/cli/build-watch/build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ import { describe, test } from 'vitest';
describe('build --watch command', async () => {
test('basic', async () => {
const distPath = path.join(__dirname, 'dist');
const dist1Path = path.join(__dirname, 'dist-1');
fse.removeSync(distPath);

fse.removeSync(dist1Path);

const distEsmIndexFile = path.join(__dirname, 'dist/esm/index.js');
const dist1EsmIndexFile = path.join(__dirname, 'dist-1/esm/index.js');

const tempConfigFile = path.join(__dirname, 'test-temp-rslib.config.mjs');

fse.outputFileSync(
Expand All @@ -26,24 +32,26 @@ export default defineConfig({
cwd: __dirname,
});

const distEsmIndexFile = path.join(__dirname, 'dist/esm/index.js');

await awaitFileExists(distEsmIndexFile);

fse.removeSync(distPath);

fse.outputFileSync(
tempConfigFile,
`import { defineConfig } from '@rslib/core';
import { generateBundleEsmConfig } from 'test-helper';

export default defineConfig({
lib: [generateBundleEsmConfig()],
lib: [generateBundleEsmConfig({
output: {
distPath: {
root: './dist-1/esm',
},
},
})],
});
`,
);

await awaitFileExists(distEsmIndexFile);
await awaitFileExists(dist1EsmIndexFile);

process.kill();
});
Expand Down
Loading