Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: should run watch cases test in build assets #7897

Merged
merged 3 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 3 additions & 1 deletion packages/rspack-test-tools/src/processor/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,13 @@ export class WatchProcessor<
if (!options.context) options.context = tempDir;
if (!options.entry) options.entry = "./index.js";
if (!options.target) options.target = "async-node";
if (!options.devtool) options.devtool = false;
if (!options.output) options.output = {};
if (!options.output.path) options.output.path = context.getDist();
if (typeof options.output.pathinfo === "undefined")
options.output.pathinfo = true;
if (!options.output.filename) options.output.filename = "bundle.js";
if (!options.output.filename)
options.output.filename = `bundle${index}.js`;
if (options.cache && (options.cache as any).type === "filesystem") {
const cacheDirectory = path.join(tempDir, ".cache");
(options.cache as any).cacheDirectory = cacheDirectory;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import module from "./file";

it("should watch for multiply compiler", function () {
it("should watch for multiply compiler (entry1)", function () {
expect(module).toBe(WATCH_STEP);
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import module from "./file";

it("should watch for multiply compiler", function () {
it("should watch for multiply compiler (entry2)", function () {
expect(module).toBe(WATCH_STEP);
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const fs = __non_webpack_require__("fs");
const path = __non_webpack_require__("path");

it("should detect changes for loader fileDependency which out of context", function () {
const less = fs.readFileSync(path.resolve(__dirname, "bundle.css"), "utf-8");
const less = fs.readFileSync(path.resolve(__dirname, "bundle0.css"), "utf-8");
const step = /step: (.*);/.exec(less)[1];
expect(step).toBe(WATCH_STEP);
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
module.exports = {
documentType: 'fake',
findBundle() {
return ['bundle.css', 'bundle.js']
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {value} from "./module";

it("should have correct export from re-exports", function () {
expect(value).toBe("foo");
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import {v} from './reexports'
// ...
export const value = '' + v;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import {v} from './reexports'
export const value = '' + v;
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,5 @@ module.exports = {
optimization: {
sideEffects: true,
providedExports: true,
},
experiments: {
rspackFuture: {
newIncremental: true
}
}
};
Loading