-
-
Notifications
You must be signed in to change notification settings - Fork 257
Closed
Description
Version
System:
OS: Windows 11 10.0.26100
CPU: (24) x64 AMD Ryzen 9 3900XT 12-Core Processor
Memory: 8.81 GB / 31.92 GB
Browsers:
Edge: Chromium (131.0.2903.86)
Internet Explorer: 11.0.26100.1882
npmPackages:
@rsbuild/core: ^1.3.16 => 1.3.16Details
When the api.transform is used, it runs on unrelated file change. This brings unexpected behavior and unexpected transforms.
In next example, api.transform runs always when .ts, .css, .html file is changed. And triggers transform for both .html files.
Example:
import { type RsbuildPlugin, defineConfig, logger } from "@rsbuild/core";
export default defineConfig(() => {
return {
plugins: [
{
name: "test-plugin",
setup(api) {
api.transform({ test: /\.html$/ }, ({ resource }) => {
logger.error(resource, { timestamp: Date.now() });
return `export default "${resource}";`;
});
},
} satisfies RsbuildPlugin,
],
source: {
entry: {
index: {
import: "./src/ts/index.tsx",
},
main: {
import: "./src/ts/main.tsx",
},
},
},
html: {
template: ({ entryName }) => `./src/${entryName}.html`,
},
};
});Reproduce link
Repo in attachments
Reproduce Steps
- npm install
- npm run dev
- make change in .css file
- check console log
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels