-
-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(option): added testing of disableAsync option
- Loading branch information
1 parent
e6358e1
commit 4bcbcd4
Showing
6 changed files
with
88 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>mini-css-extract-plugin testcase</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" type="text/css" href="/dist/a.css" /> | ||
</head> | ||
<body> | ||
<script type="text/javascript" src="/dist/a.js"></script> | ||
<script type="text/javascript" src="/dist/b.js"></script> | ||
<script type="text/javascript" src="/dist/main.js"></script> | ||
</body> | ||
</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,7 @@ | ||
.container { | ||
background: blue; | ||
color: red; | ||
width: 100%; | ||
height: 20px; | ||
text-align: center; | ||
} |
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 @@ | ||
.container { | ||
background: purple; | ||
color: green; | ||
width: 100%; | ||
height: 20px; | ||
text-align: center; | ||
} |
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,13 @@ | ||
/* eslint-env browser */ | ||
|
||
import './a.css'; | ||
import './b.css'; | ||
|
||
const render = () => { | ||
const div = document.createElement('div'); | ||
div.setAttribute('class', 'container'); | ||
div.innerHTML = 'My background color should be blue, and my text should be red!'; | ||
document.body.appendChild(div); | ||
}; | ||
|
||
render(); |
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,45 @@ | ||
const Self = require('../../'); | ||
|
||
module.exports = { | ||
mode: 'development', | ||
output: { | ||
chunkFilename: '[name].js', | ||
publicPath: '/dist/', | ||
crossOriginLoading: 'anonymous', | ||
}, | ||
optimization: { | ||
splitChunks: { | ||
cacheGroups: { | ||
default: false, | ||
a: { | ||
name: 'a', | ||
test: /a.css/, | ||
chunks: 'all', | ||
enforce: true, | ||
}, | ||
b: { | ||
name: 'b', | ||
test: /b.css/, | ||
chunks: 'all', | ||
enforce: true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.css$/, | ||
use: [Self.loader, 'css-loader'], | ||
}, | ||
], | ||
}, | ||
plugins: [ | ||
new Self({ | ||
filename: '[name].css', | ||
}), | ||
], | ||
devServer: { | ||
contentBase: __dirname, | ||
}, | ||
}; |