Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions crates/rspack_core/src/compiler/make/cutout/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ impl Cutout {
if module.depends_on(&files) {
// add module id
force_build_modules.insert(module.identifier());
// process parent module id
// process module dependencies
for connect in module_graph.get_incoming_connections(&module.identifier()) {
if let Some(original_module_identifier) = connect.original_module_identifier {
force_build_modules.insert(original_module_identifier);
}
force_build_deps.insert(connect.dependency_id);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/rspack-test-tools/src/processor/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ export class WatchStepProcessor<
resolve(stats);
});
});
// wait compiler to ready watch the files and diretories
await new Promise(resolve => setTimeout(resolve, 100));
copyDiff(
path.join(context.getSource(), this._watchOptions.stepName),
this._watchOptions.tempDir,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import("./foo.js").catch(() => {

});
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = [
/Module not found: Can't resolve/
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DELETE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = function (source) {
this._module.buildInfo.timestamp = Date.now();
return source;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const path = require("path");

class Plugin {
apply(compiler) {
const moduleMap = new Map();

compiler.hooks.compilation.tap("PLUGIN", compilation => {
compilation.hooks.finishModules.tap("PLUGIN", modules => {
for (const module of modules) {
if (moduleMap.has(module.resource)) {
const timestamp = moduleMap.get(module.resource);
// index.js only run loader by once.
expect(module.buildInfo.timestamp).toBe(timestamp);
} else {
moduleMap.set(module.resource, module.buildInfo.timestamp);
}
}
});
});
}
}

module.exports = {
plugins: [
new Plugin()
],
module: {
rules: [
{
test: /\.js$/,
use: [
{
loader: path.join(__dirname, "loader.js"),
}
]
}
]
}
};

Loading