Skip to content
Open
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
35 changes: 35 additions & 0 deletions packages/wxt/e2e/tests/output-structure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,41 @@ describe('Output Directory Structure', () => {
`);
});

it('should not duplicate content script CSS in assets/ directory', async () => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran this test on main, it already passes

const project = new TestProject();
project.addFile(
'entrypoints/content.content/index.ts',
`import './style.css';
export default defineContentScript({
matches: ["*://*/*"],
main: () => {},
})`,
);
project.addFile(
'entrypoints/content.content/style.css',
`body { color: blue; }`,
);

await project.build();

// Verify CSS only exists in content-scripts/, not in assets/
expect(
await project.pathExists(
'.output/chrome-mv3/content-scripts/content.css',
),
).toBe(true);
expect(
await project.pathExists('.output/chrome-mv3/assets/content.css'),
).toBe(false);

// Verify the manifest references the correct CSS file
const manifest = await project.serializeFile(
'.output/chrome-mv3/manifest.json',
);
expect(manifest).toContain('content-scripts/content.css');
expect(manifest).not.toContain('assets/content.css');
});

it("should output to a custom directory when overriding 'outDir'", async () => {
const project = new TestProject();
project.addFile('entrypoints/unlisted.html', '<html></html>');
Expand Down
Loading