Skip to content

Commit 240391e

Browse files
authored
fix(create-rslib): add env.d.ts to React/Vue templates (#1594)
1 parent 88440f2 commit 240391e

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="@rslib/core/types" />
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="@rslib/core/types" />

packages/create-rslib/test/helper.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,17 @@ export const createAndValidate = (
7777
expect(existsSync(path.join(dir, 'tsconfig.json'))).toBeTruthy();
7878
}
7979

80+
if (
81+
templateCase.lang === 'ts' &&
82+
(templateCase.template === 'react' || templateCase.template === 'vue')
83+
) {
84+
const envDtsPath = path.join(dir, 'src/env.d.ts');
85+
expect(existsSync(envDtsPath)).toBeTruthy();
86+
expect(fse.readFileSync(envDtsPath, 'utf-8').trimEnd()).toBe(
87+
'/// <reference types="@rslib/core/types" />',
88+
);
89+
}
90+
8091
// tool - Storybook
8192
if (templateCase.tools.includes('storybook')) {
8293
for (const file of [

0 commit comments

Comments
 (0)