-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for css-loader option exportType as css-style-sheet
- Loading branch information
Showing
23 changed files
with
398 additions
and
10 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
20 changes: 20 additions & 0 deletions
20
test/cases/js-import-css-modules-type-css-style-sheet-mix/expected/index.html
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,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Test</title> | ||
<link href="style-a.22451d9b.css" rel="stylesheet" /> | ||
<style>.red { | ||
border: 5px solid red; | ||
color: indianred; | ||
} | ||
</style> | ||
<link href="main.dc4ea4af.css" rel="stylesheet"> | ||
<script src="main.cc0cc899.js" async defer="defer"></script> | ||
</head> | ||
<body> | ||
<h1>Hello World!</h1> | ||
<div class="red">Red</div> | ||
<div class="lime-green">Green</div> | ||
<div class="royal-blue">Blue</div> | ||
</body> | ||
</html> |
1 change: 1 addition & 0 deletions
1
test/cases/js-import-css-modules-type-css-style-sheet-mix/expected/main.cc0cc899.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
test/cases/js-import-css-modules-type-css-style-sheet-mix/expected/main.dc4ea4af.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 @@ | ||
.royal-blue { | ||
border: 5px solid royalblue; | ||
color: royalblue; | ||
} |
4 changes: 4 additions & 0 deletions
4
test/cases/js-import-css-modules-type-css-style-sheet-mix/expected/style-a.22451d9b.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 @@ | ||
h1 { | ||
color: coral; | ||
font-size: 20px; | ||
} |
15 changes: 15 additions & 0 deletions
15
test/cases/js-import-css-modules-type-css-style-sheet-mix/src/index.html
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,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Test</title> | ||
<link href="./style-a.css" rel="stylesheet" /> | ||
<link href="./style-b.css?inline" rel="stylesheet" /> | ||
<script src="./main.js" async defer="defer"></script> | ||
</head> | ||
<body> | ||
<h1>Hello World!</h1> | ||
<div class="red">Red</div> | ||
<div class="lime-green">Green</div> | ||
<div class="royal-blue">Blue</div> | ||
</body> | ||
</html> |
7 changes: 7 additions & 0 deletions
7
test/cases/js-import-css-modules-type-css-style-sheet-mix/src/main.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,7 @@ | ||
import sheet from './style-c.css?sheet'; // `css-loader` option `exportType: 'css-style-sheet'` | ||
import './style-d.css'; // `css-loader` option `exportType: 'array'` | ||
|
||
console.log('sheet: ', sheet); | ||
|
||
document.adoptedStyleSheets = [sheet]; | ||
//shadowRoot.adoptedStyleSheets = [sheet]; // error in browser: shadowRoot is not defined |
4 changes: 4 additions & 0 deletions
4
test/cases/js-import-css-modules-type-css-style-sheet-mix/src/style-a.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 @@ | ||
h1 { | ||
color: coral; | ||
font-size: 20px; | ||
} |
4 changes: 4 additions & 0 deletions
4
test/cases/js-import-css-modules-type-css-style-sheet-mix/src/style-b.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 @@ | ||
.red { | ||
border: 5px solid red; | ||
color: indianred; | ||
} |
4 changes: 4 additions & 0 deletions
4
test/cases/js-import-css-modules-type-css-style-sheet-mix/src/style-c.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 @@ | ||
.lime-green { | ||
border: 5px solid limegreen; | ||
color: limegreen; | ||
} |
4 changes: 4 additions & 0 deletions
4
test/cases/js-import-css-modules-type-css-style-sheet-mix/src/style-d.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 @@ | ||
.royal-blue { | ||
border: 5px solid royalblue; | ||
color: royalblue; | ||
} |
Oops, something went wrong.