-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Css modules improved support (#2284)
* Add CSSModules tests, fix configuration * Add test cases
- Loading branch information
Showing
19 changed files
with
291 additions
and
35 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
116 changes: 102 additions & 14 deletions
116
packages/integration/__tests__/__snapshots__/crafty-preset-postcss-webpack.js.md
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+1.95 KB
(160%)
packages/integration/__tests__/__snapshots__/crafty-preset-postcss-webpack.js.snap
Binary file not shown.
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
12 changes: 12 additions & 0 deletions
12
packages/integration/fixtures/crafty-preset-postcss-webpack/modules-extract/crafty.config.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,12 @@ | ||
module.exports = { | ||
presets: [ | ||
"@swissquote/crafty-preset-postcss", | ||
"@swissquote/crafty-runner-webpack" | ||
], | ||
js: { | ||
myBundle: { | ||
source: "js/app.js", | ||
extractCSS: "[name].[bundle].min.css" | ||
} | ||
} | ||
}; |
9 changes: 9 additions & 0 deletions
9
...ges/integration/fixtures/crafty-preset-postcss-webpack/modules-extract/css/app.module.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,9 @@ | ||
:global .t-global { | ||
:local .app { | ||
color:red; | ||
} | ||
} | ||
|
||
:global(.t-global) .app2 { | ||
color: green; | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/integration/fixtures/crafty-preset-postcss-webpack/modules-extract/css/style.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,3 @@ | ||
.Button { | ||
color: orange; | ||
} |
3 changes: 3 additions & 0 deletions
3
.../integration/fixtures/crafty-preset-postcss-webpack/modules-extract/css/subapp.module.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,3 @@ | ||
.subapp { | ||
color:orange; | ||
} |
8 changes: 8 additions & 0 deletions
8
packages/integration/fixtures/crafty-preset-postcss-webpack/modules-extract/js/app.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,8 @@ | ||
import "../css/style"; | ||
import style from "../css/app.module.css"; | ||
|
||
export default function app() { | ||
console.log(style.app); | ||
|
||
import(/* webpackChunkName: "subapp" */ "./subapp"); | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/integration/fixtures/crafty-preset-postcss-webpack/modules-extract/js/subapp.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 @@ | ||
import style from "../css/subapp.module.css"; | ||
|
||
export default function subapp() { | ||
console.log(style.subapp) | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/integration/fixtures/crafty-preset-postcss-webpack/modules-inline/crafty.config.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,12 @@ | ||
module.exports = { | ||
presets: [ | ||
"@swissquote/crafty-preset-postcss", | ||
"@swissquote/crafty-runner-webpack" | ||
], | ||
js: { | ||
myBundle: { | ||
source: "js/app.js", | ||
//extractCSS: "[name].[bundle].min.css" | ||
} | ||
} | ||
}; |
9 changes: 9 additions & 0 deletions
9
...ages/integration/fixtures/crafty-preset-postcss-webpack/modules-inline/css/app.module.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,9 @@ | ||
:global .t-global { | ||
:local .app { | ||
color:red; | ||
} | ||
} | ||
|
||
:global(.t-global) .app2 { | ||
color: green; | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/integration/fixtures/crafty-preset-postcss-webpack/modules-inline/css/style.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,3 @@ | ||
.Button { | ||
color: orange; | ||
} |
4 changes: 4 additions & 0 deletions
4
...s/integration/fixtures/crafty-preset-postcss-webpack/modules-inline/css/subapp.module.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 @@ | ||
.subapp { | ||
color:orange; | ||
} | ||
|
8 changes: 8 additions & 0 deletions
8
packages/integration/fixtures/crafty-preset-postcss-webpack/modules-inline/js/app.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,8 @@ | ||
import "../css/style"; | ||
import style from "../css/app.module.css"; | ||
|
||
export default function app() { | ||
console.log(style.app); | ||
|
||
import(/* webpackChunkName: "subapp" */ "./subapp"); | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/integration/fixtures/crafty-preset-postcss-webpack/modules-inline/js/subapp.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 @@ | ||
import style from "../css/subapp.module.css"; | ||
|
||
export default function subapp() { | ||
console.log(style.subapp) | ||
} |
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