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 nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"prebundle": [
"{projectRoot}/package.json",
"{projectRoot}/prebundle.config.mjs"
"{projectRoot}/prebundle.config.ts"
]
},
"targetDefaults": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"postcss": "^8.5.6",
"postcss-load-config": "6.0.1",
"postcss-loader": "8.2.0",
"prebundle": "1.4.2",
"prebundle": "1.5.0",
"range-parser": "^1.2.1",
"reduce-configs": "^1.1.1",
"rslog": "^1.3.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// @ts-check
import fs from 'node:fs';
import { join } from 'node:path';
import type { Config } from 'prebundle';

function replaceFileContent(filePath, replaceFn) {
function replaceFileContent(
filePath: string,
replaceFn: (content: string) => string,
) {
const content = fs.readFileSync(filePath, 'utf-8');
const newContent = replaceFn(content);
if (newContent !== content) {
fs.writeFileSync(filePath, newContent);
}
}

/** @type {import('prebundle').Config} */
export default {
prettier: true,
externals: {
Expand Down Expand Up @@ -179,4 +181,4 @@ export type SourceMapGenerator = unknown;
},
},
],
};
} satisfies Config;
2 changes: 1 addition & 1 deletion packages/core/rslib.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { nodeMinifyConfig } from '@rsbuild/config/rslib.config.ts';
import type { Rspack, rsbuild } from '@rslib/core';
import { defineConfig } from '@rslib/core';
import pkgJson from './package.json' with { type: 'json' };
import prebundleConfig from './prebundle.config.mjs';
import prebundleConfig from './prebundle.config.ts';

export const define = {
RSBUILD_VERSION: JSON.stringify(pkgJson.version),
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@scripts/test-helper": "workspace:*",
"@types/node": "^22.18.12",
"babel-loader": "10.0.0",
"prebundle": "1.4.2",
"prebundle": "1.5.0",
"typescript": "^5.9.3"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check
/** @type {import('prebundle').Config} */
import type { Config } from 'prebundle';

export default {
prettier: true,
dependencies: [
Expand All @@ -11,4 +11,4 @@ export default {
},
},
],
};
} satisfies Config;
2 changes: 1 addition & 1 deletion packages/plugin-less/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@types/less": "^3.0.8",
"less": "4.3.0",
"less-loader": "^12.3.0",
"prebundle": "1.4.2",
"prebundle": "1.5.0",
"typescript": "^5.9.3"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import fs from 'node:fs';
// @ts-check
import { join } from 'node:path';
import type { Config } from 'prebundle';

function replaceFileContent(filePath, replaceFn) {
function replaceFileContent(
filePath: string,
replaceFn: (content: string) => string,
) {
const content = fs.readFileSync(filePath, 'utf-8');
const newContent = replaceFn(content);
if (newContent !== content) {
fs.writeFileSync(filePath, newContent);
}
}

/** @type {import('prebundle').Config} */
export default {
prettier: true,
dependencies: [
Expand Down Expand Up @@ -41,4 +43,4 @@ export default {
},
},
],
};
} satisfies Config;
2 changes: 1 addition & 1 deletion packages/plugin-sass/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@scripts/test-helper": "workspace:*",
"@types/node": "^22.18.12",
"@types/sass-loader": "^8.0.10",
"prebundle": "1.4.2",
"prebundle": "1.5.0",
"resolve-url-loader": "^5.0.0",
"sass-loader": "^16.0.6",
"typescript": "^5.9.3"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// @ts-check
import fs from 'node:fs';
import { join } from 'node:path';
import type { Config } from 'prebundle';

function replaceFileContent(filePath, replaceFn) {
function replaceFileContent(
filePath: string,
replaceFn: (content: string) => string,
) {
const content = fs.readFileSync(filePath, 'utf-8');
const newContent = replaceFn(content);
if (newContent !== content) {
fs.writeFileSync(filePath, newContent);
}
}

/** @type {import('prebundle').Config} */
export default {
prettier: true,
dependencies: [
Expand Down Expand Up @@ -41,4 +43,4 @@ export default {
},
},
],
};
} satisfies Config;
2 changes: 1 addition & 1 deletion packages/plugin-svgr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@scripts/test-helper": "workspace:*",
"@types/node": "^22.18.12",
"file-loader": "6.2.0",
"prebundle": "1.4.2",
"prebundle": "1.5.0",
"svgo": "^3.3.2",
"typescript": "^5.9.3",
"url-loader": "4.1.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// @ts-check
import { readFileSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
import type { Config } from 'prebundle';

/** @type {import('prebundle').Config} */
export default {
prettier: true,
dependencies: [
Expand Down Expand Up @@ -32,4 +31,4 @@ export default {
},
},
],
};
} satisfies Config;
34 changes: 17 additions & 17 deletions pnpm-lock.yaml

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

Loading