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
1 change: 1 addition & 0 deletions plugin-packs/postcss-bundler/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Unreleased (patch)

- Ignore `@import {}` blocks
- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`4.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#401) (patch)

### 3.0.0
Expand Down
2 changes: 1 addition & 1 deletion plugin-packs/postcss-bundler/dist/index.mjs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ function consumeLayers(nodes: Array<ChildNode>, conditions: Array<Condition>, cu
}

function parseImport(result: Result, atRule: AtRule, importingNode: AtRule | null, conditions: Array<Condition>, from: Array<string>): Warning | ImportStatement {
if (atRule.nodes) {
return result.warn(`Invalid @import block in '${atRule.toString()}'`, {
node: atRule,
});
}

const parsed = parseAtImport(atRule.params);
if (!parsed) {
return result.warn(`Invalid @import statement in '${atRule.toString()}'`, {
Expand Down
3 changes: 3 additions & 0 deletions plugin-packs/postcss-bundler/test/_tape.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ const testCases = {
case 'test/css-import-tests/001-core-features/forwards-compat/004':
testCases[key].warnings = 1;
break;
case 'test/css-import-tests/001-core-features/forwards-compat/009':
testCases[key].warnings = 1;
break;
case 'test/css-import-tests/002-sub-features/003-at-layer/013':
testCases[key].warnings = 1;
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.box {
background-color: green;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.box {
background-color: red;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import url("green.css");
@import url("red.css") {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* green.css */
.box {
background-color: green;
}
Loading