Skip to content

Commit d898e7d

Browse files
committed
add test case for shared imports
1 parent e798a23 commit d898e7d

File tree

8 files changed

+63
-0
lines changed

8 files changed

+63
-0
lines changed

test/cases/shared-import/a.css

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@import "./shared.css";
2+
3+
.shared {
4+
color: red;
5+
}

test/cases/shared-import/b.css

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@import "./shared.css";
2+
3+
.shared {
4+
background-color: red;
5+
}

test/cases/shared-import/c.css

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@import "./shared.css";
2+
3+
.shared {
4+
border: 1px solid red;
5+
}
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.shared {
2+
border: 1px solid red;
3+
}
4+
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.shared {
2+
color: green;
3+
background-color: green;
4+
border: 1px solid green;
5+
}
6+
7+
.shared {
8+
color: red;
9+
}
10+
11+
.shared {
12+
background-color: red;
13+
}
14+

test/cases/shared-import/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import './a.css';
2+
import './b.css';
3+
4+
import("./c.css");

test/cases/shared-import/shared.css

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.shared {
2+
color: green;
3+
background-color: green;
4+
border: 1px solid green;
5+
}
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const Self = require('../../../');
2+
3+
module.exports = {
4+
entry: './index.js',
5+
module: {
6+
rules: [
7+
{
8+
test: /\.css$/,
9+
use: [
10+
Self.loader,
11+
'css-loader',
12+
],
13+
},
14+
],
15+
},
16+
plugins: [
17+
new Self({
18+
filename: '[name].css',
19+
}),
20+
],
21+
};

0 commit comments

Comments
 (0)