File tree Expand file tree Collapse file tree 13 files changed +47
-42
lines changed Expand file tree Collapse file tree 13 files changed +47
-42
lines changed Original file line number Diff line number Diff line change 1212 ],
1313 "prebundle" : [
1414 " {projectRoot}/package.json" ,
15- " {projectRoot}/prebundle.config.mjs "
15+ " {projectRoot}/prebundle.config.ts "
1616 ]
1717 },
1818 "targetDefaults" : {
Original file line number Diff line number Diff line change 8888 "postcss" : " ^8.5.6" ,
8989 "postcss-load-config" : " 6.0.1" ,
9090 "postcss-loader" : " 8.2.0" ,
91- "prebundle" : " 1.4.2 " ,
91+ "prebundle" : " 1.5.0 " ,
9292 "range-parser" : " ^1.2.1" ,
9393 "reduce-configs" : " ^1.1.1" ,
9494 "rslog" : " ^1.3.0" ,
Original file line number Diff line number Diff line change 1- // @ts -check
21import fs from 'node:fs' ;
32import { join } from 'node:path' ;
3+ import type { Config } from 'prebundle' ;
44
5- function replaceFileContent ( filePath , replaceFn ) {
5+ function replaceFileContent (
6+ filePath : string ,
7+ replaceFn : ( content : string ) => string ,
8+ ) {
69 const content = fs . readFileSync ( filePath , 'utf-8' ) ;
710 const newContent = replaceFn ( content ) ;
811 if ( newContent !== content ) {
912 fs . writeFileSync ( filePath , newContent ) ;
1013 }
1114}
1215
13- /** @type {import('prebundle').Config } */
1416export default {
1517 prettier : true ,
1618 externals : {
@@ -179,4 +181,4 @@ export type SourceMapGenerator = unknown;
179181 } ,
180182 } ,
181183 ] ,
182- } ;
184+ } satisfies Config ;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { nodeMinifyConfig } from '@rsbuild/config/rslib.config.ts';
44import type { Rspack , rsbuild } from '@rslib/core' ;
55import { defineConfig } from '@rslib/core' ;
66import pkgJson from './package.json' with { type : 'json' } ;
7- import prebundleConfig from './prebundle.config.mjs ' ;
7+ import prebundleConfig from './prebundle.config.ts ' ;
88
99export const define = {
1010 RSBUILD_VERSION : JSON . stringify ( pkgJson . version ) ,
Original file line number Diff line number Diff line change 4444 "@scripts/test-helper" : " workspace:*" ,
4545 "@types/node" : " ^22.18.12" ,
4646 "babel-loader" : " 10.0.0" ,
47- "prebundle" : " 1.4.2 " ,
47+ "prebundle" : " 1.5.0 " ,
4848 "typescript" : " ^5.9.3"
4949 },
5050 "peerDependencies" : {
Original file line number Diff line number Diff line change 1- // @ts -check
2- /** @type { import('prebundle').Config } */
1+ import type { Config } from 'prebundle' ;
2+
33export default {
44 prettier : true ,
55 dependencies : [
@@ -11,4 +11,4 @@ export default {
1111 } ,
1212 } ,
1313 ] ,
14- } ;
14+ } satisfies Config ;
Original file line number Diff line number Diff line change 4040 "@types/less" : " ^3.0.8" ,
4141 "less" : " 4.3.0" ,
4242 "less-loader" : " ^12.3.0" ,
43- "prebundle" : " 1.4.2 " ,
43+ "prebundle" : " 1.5.0 " ,
4444 "typescript" : " ^5.9.3"
4545 },
4646 "peerDependencies" : {
Original file line number Diff line number Diff line change 11import fs from 'node:fs' ;
2- // @ts -check
32import { join } from 'node:path' ;
3+ import type { Config } from 'prebundle' ;
44
5- function replaceFileContent ( filePath , replaceFn ) {
5+ function replaceFileContent (
6+ filePath : string ,
7+ replaceFn : ( content : string ) => string ,
8+ ) {
69 const content = fs . readFileSync ( filePath , 'utf-8' ) ;
710 const newContent = replaceFn ( content ) ;
811 if ( newContent !== content ) {
912 fs . writeFileSync ( filePath , newContent ) ;
1013 }
1114}
1215
13- /** @type {import('prebundle').Config } */
1416export default {
1517 prettier : true ,
1618 dependencies : [
@@ -41,4 +43,4 @@ export default {
4143 } ,
4244 } ,
4345 ] ,
44- } ;
46+ } satisfies Config ;
Original file line number Diff line number Diff line change 4242 "@scripts/test-helper" : " workspace:*" ,
4343 "@types/node" : " ^22.18.12" ,
4444 "@types/sass-loader" : " ^8.0.10" ,
45- "prebundle" : " 1.4.2 " ,
45+ "prebundle" : " 1.5.0 " ,
4646 "resolve-url-loader" : " ^5.0.0" ,
4747 "sass-loader" : " ^16.0.6" ,
4848 "typescript" : " ^5.9.3"
Original file line number Diff line number Diff line change 1- // @ts -check
21import fs from 'node:fs' ;
32import { join } from 'node:path' ;
3+ import type { Config } from 'prebundle' ;
44
5- function replaceFileContent ( filePath , replaceFn ) {
5+ function replaceFileContent (
6+ filePath : string ,
7+ replaceFn : ( content : string ) => string ,
8+ ) {
69 const content = fs . readFileSync ( filePath , 'utf-8' ) ;
710 const newContent = replaceFn ( content ) ;
811 if ( newContent !== content ) {
912 fs . writeFileSync ( filePath , newContent ) ;
1013 }
1114}
1215
13- /** @type {import('prebundle').Config } */
1416export default {
1517 prettier : true ,
1618 dependencies : [
@@ -41,4 +43,4 @@ export default {
4143 } ,
4244 } ,
4345 ] ,
44- } ;
46+ } satisfies Config ;
You can’t perform that action at this time.
0 commit comments