File tree Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change 1- package.json
2-
31# Ignore generated
42dist /
5- packages / rspack / src / config / schema.check.js
3+ compiled /
64
75# Ignore lock files
86pnpm-lock.yaml
Original file line number Diff line number Diff line change 11// @ts -check
2+ import { readFileSync , writeFileSync } from "node:fs" ;
3+ import { join } from "node:path" ;
4+
25/** @type {import('prebundle').Config } */
36export default {
47 dependencies : [
8+ "@swc/types" ,
9+ "graceful-fs" ,
10+ "browserslist-load-config" ,
511 {
612 name : "webpack-sources" ,
713 copyDts : true
814 } ,
9- "graceful-fs" ,
10- "browserslist-load-config" ,
1115 {
1216 name : "watchpack" ,
1317 externals : {
1418 "graceful-fs" : "../graceful-fs/index.js"
19+ } ,
20+ afterBundle ( task ) {
21+ const importStatement = "import fs from 'graceful-fs';" ;
22+ const dtsPath = join ( task . distPath , "index.d.ts" ) ;
23+ const content = readFileSync ( dtsPath , "utf-8" ) ;
24+ writeFileSync (
25+ dtsPath ,
26+ content . replace ( importStatement , `// @ts-ignore\n${ importStatement } ` )
27+ ) ;
1528 }
16- } ,
17- {
18- name : "@swc/types"
1929 }
2030 ]
2131} ;
Original file line number Diff line number Diff line change 11{
22 "extends" : " ./tsconfig.build.json" ,
33 "compilerOptions" : {
4- "paths" : {}
4+ "paths" : {}
55 }
66}
You can’t perform that action at this time.
0 commit comments