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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"pnpm": "10.18.3"
},
"devDependencies": {
"@biomejs/biome": "^2.2.6",
"@biomejs/biome": "^2.3.2",
"@microsoft/api-extractor": "7.52.15",
"@microsoft/api-extractor-model": "7.31.3",
"@rslint/core": "0.1.13",
Expand Down
18 changes: 10 additions & 8 deletions packages/rspack-test-tools/src/case/esm-output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ const creator = new BasicCaseCreator({
const testConfig = context.getTestConfig();
if (testConfig.esmLibPluginOptions) {
let target;
const otherPlugins = options.plugins?.filter(plugin => {
const isTarget =
plugin instanceof rspack.experiments.EsmLibraryPlugin;
if (isTarget) {
target = plugin;
}
return !isTarget;
})!;

const otherPlugins =
options.plugins?.filter(plugin => {
const isTarget =
plugin instanceof rspack.experiments.EsmLibraryPlugin;
if (isTarget) {
target = plugin;
}
return !isTarget;
}) ?? [];

options.plugins = [
...otherPlugins,
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack-test-tools/src/case/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ function cachedWatchStats(
): () => StatsCompilation {
const compiler = context.getCompiler();
const watchContext = context.getValue("watchContext") as any;
const stepName: string = watchContext?.step!;
const stepName: string = watchContext?.step;
const statsGetter = (() => {
const cached: Record<string, StatsCompilation> = {};
return () => {
Expand Down
8 changes: 6 additions & 2 deletions packages/rspack/src/taps/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,13 @@ export const createCompilerHooksRegisters: CreatePartialRegisters<
targetPath,
outputPath,
get source() {
return getCompiler()
const source = getCompiler()
.__internal__get_compilation()!
.getAsset(filename)?.source!;
.getAsset(filename)?.source;
if (!source) {
throw new Error(`Asset ${filename} not found`);
}
return source;
},
get content() {
return this.source?.buffer();
Expand Down
76 changes: 38 additions & 38 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading