Skip to content

Commit 07fb937

Browse files
committed
add import with external URL
This guarantees that: 1. The `@import` is not modified in any way, shape or form 2. The `@import` doesn't crash the rest of the system 3. Imports later in the file are still migrated as expected
1 parent e94eac4 commit 07fb937

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/@tailwindcss-upgrade/src/codemods/migrate-import.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ async function migrate(input: string) {
1515
it('prints relative file imports as relative paths', async () => {
1616
expect(
1717
await migrate(css`
18+
@import url('https://example.com');
19+
1820
@import 'fixtures/test';
1921
@import 'fixtures/test.css';
2022
@import './fixtures/test.css';
@@ -53,7 +55,9 @@ it('prints relative file imports as relative paths', async () => {
5355
@import 'tailwindcss/theme';
5456
`),
5557
).toMatchInlineSnapshot(`
56-
"@import './fixtures/test.css';
58+
"@import url('https://example.com');
59+
60+
@import './fixtures/test.css';
5761
@import './fixtures/test.css';
5862
@import './fixtures/test.css';
5963
@import './fixtures/test.css';

0 commit comments

Comments
 (0)