Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix postcss modules composes imports (#2642)
* Allow parcel paths for css modules * Fix duplicate css rules for css modules Fixes: #2592 * Fix sass imports for css modules Fixes #2501 * Adjust tests for changed class pattern * Add postcss composes tests * Add postcss composes tests for edge cases * Fix postcss composes dependency regexp to include all kind of class names * Ensure tests run across different filesystems * Fix postcss module loading on windows * Cleanup css modules loader
- Loading branch information
1 parent
8afacc3
commit f269e3e
Showing
22 changed files
with
349 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/core/integration-tests/test/integration/postcss-composes/.postcssrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"modules": true | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/core/integration-tests/test/integration/postcss-composes/composes-1.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.composes1 { | ||
composes: test from './mixins.css'; | ||
border: 3px solid orange; | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/core/integration-tests/test/integration/postcss-composes/composes-2.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.composes2 { | ||
composes: test from './mixins.css'; | ||
border: 3px solid red; | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/core/integration-tests/test/integration/postcss-composes/composes-3.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.composes3 { | ||
composes: test from './mixins.scss'; | ||
border: 3px solid brown; | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/core/integration-tests/test/integration/postcss-composes/composes-4.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.composes4 { | ||
composes: test from '~mixins.css'; | ||
border: 3px solid black; | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/core/integration-tests/test/integration/postcss-composes/composes-5.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.composes5 { | ||
composes: intermediate from './mixins-intermediate.css'; | ||
border: 3px solid yellow; | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/core/integration-tests/test/integration/postcss-composes/composes-6.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.composes6 { | ||
composes: test test-2 from './mixins.css'; | ||
border: 3px solid orangered; | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/core/integration-tests/test/integration/postcss-composes/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var map1 = require('./composes-1.css'); | ||
var map2 = require('./composes-2.css'); | ||
|
||
module.exports = function () { | ||
return Object.assign({}, map1, map2); | ||
}; |
5 changes: 5 additions & 0 deletions
5
packages/core/integration-tests/test/integration/postcss-composes/index2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var map3 = require('./composes-3.css'); | ||
|
||
module.exports = function () { | ||
return map3; | ||
}; |
5 changes: 5 additions & 0 deletions
5
packages/core/integration-tests/test/integration/postcss-composes/index3.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var map4 = require('./composes-4.css'); | ||
|
||
module.exports = function () { | ||
return map4; | ||
}; |
5 changes: 5 additions & 0 deletions
5
packages/core/integration-tests/test/integration/postcss-composes/index4.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var map5 = require('./composes-5.css'); | ||
|
||
module.exports = function () { | ||
return map5; | ||
}; |
5 changes: 5 additions & 0 deletions
5
packages/core/integration-tests/test/integration/postcss-composes/index5.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var map6 = require('./composes-6.css'); | ||
|
||
module.exports = function () { | ||
return map6; | ||
}; |
4 changes: 4 additions & 0 deletions
4
packages/core/integration-tests/test/integration/postcss-composes/mixins-intermediate.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.intermediate { | ||
composes: test from './mixins.css'; | ||
height: 300px; | ||
} |
8 changes: 8 additions & 0 deletions
8
packages/core/integration-tests/test/integration/postcss-composes/mixins.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.test { | ||
height: 100px; | ||
width: 100px; | ||
} | ||
|
||
.test-2 { | ||
background: red; | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/core/integration-tests/test/integration/postcss-composes/mixins.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
$test: 200px; | ||
|
||
.test { | ||
height: $test; | ||
width: $test; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.