Skip to content

Commit 44456d0

Browse files
test: added
1 parent a8dde9a commit 44456d0

File tree

8 files changed

+55
-0
lines changed

8 files changed

+55
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as styles from './style.module.css';
2+
import * as styles1 from './module.js';
3+
4+
it("should not deadlock when using importModule", () => {
5+
expect(styles).toMatchObject({ "someBottom": "8px" });
6+
expect(styles1).toMatchObject({ "someBottom": "8px" });
7+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@value someBottom from "./vars.module.css";
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/** @type {import("../../../../").LoaderDefinition} */
2+
module.exports.pitch = function (request) {
3+
const callback = this.async();
4+
let finished = false;
5+
6+
this.importModule(
7+
`${this.resourcePath}.webpack[javascript/auto]!=!!!${request}`,
8+
{},
9+
(err, result) => {
10+
if (err) return callback(err);
11+
if (finished) return;
12+
finished = true;
13+
callback(null, `module.exports = ${JSON.stringify(result)};`);
14+
}
15+
);
16+
setTimeout(() => {
17+
if (finished) return;
18+
finished = true;
19+
callback(new Error("importModule is hanging"));
20+
}, 2000);
21+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './style1.module.css'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@value someBottom from "./inner.module.css";
2+
3+
.cold {
4+
bottom: someBottom;
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@value someBottom from "./inner.module.css";
2+
3+
.cold {
4+
bottom: someBottom;
5+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@value someBottom: 8px;
2+
@value someBottom1: 8px;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/** @type {import("../../../../").Configuration} */
2+
module.exports = {
3+
parallelism: 1,
4+
mode: "development",
5+
module: {
6+
rules: [
7+
{
8+
test: /\.css$/i,
9+
use: [require.resolve("./loader"), "css-loader"]
10+
}
11+
]
12+
}
13+
};

0 commit comments

Comments
 (0)