Skip to content

Commit 2466786

Browse files
feat: Support .wxtrc config file (#1833)
Co-authored-by: Aaron <[email protected]>
1 parent 25cc403 commit 2466786

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

packages/wxt/e2e/tests/user-config.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,15 @@ describe('User Config', () => {
139139
).toBe(true);
140140
});
141141

142-
it('should throw error when config file not exist', async () => {
142+
it('should not throw error when config file not exist', async () => {
143143
const project = new TestProject();
144144
project.addFile(
145-
'src/entrypoints/background.ts',
145+
'entrypoints/background.ts',
146146
`export default defineBackground(
147147
() => console.log('Hello background'),
148148
);`,
149149
);
150150

151-
await expect(
152-
project.build({ configFile: 'foo.config.ts' }),
153-
).rejects.toThrowError(/not found/);
151+
await project.build({ configFile: 'foo.config.ts' });
154152
});
155153
});

packages/wxt/src/core/resolve-config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,7 @@ export async function resolveConfig(
5050
configFile: inlineConfig.configFile,
5151
name: 'wxt',
5252
cwd: inlineConfig.root ?? process.cwd(),
53-
rcFile: false,
5453
});
55-
if (inlineConfig.configFile && metadata.layers?.length === 0) {
56-
throw Error(`Config file "${inlineConfig.configFile}" not found`);
57-
}
5854
userConfig = loadedConfig ?? {};
5955
userConfigMetadata = metadata;
6056
}

0 commit comments

Comments
 (0)