one
Version:
One is a new React Framework that makes Vite serve both native and web.
52 lines (51 loc) • 1.07 kB
JavaScript
import { writeFile } from "node:fs/promises";
import "../polyfills-server";
import { existsAsync } from "../utils/existsAsync";
function ensureTSConfig() {
existsAsync("tsconfig.json").then((hasTsConfig) => {
hasTsConfig || (console.info(
"[one] adding default tsconfig.json. to disable set one/vite { config: { tsConfigPaths: false } }"
), writeFile(
"tsconfig.json",
`{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["./*"]
},
"strict": true,
"rootDir": ".",
"module": "Preserve",
// allows react-native style imports without path extensions, for compat with platform-specific files
"moduleResolution": "Bundler",
"preserveSymlinks": true,
"skipLibCheck": true,
"jsx": "react-jsx",
"noImplicitAny": false,
"types": [
"node",
"react",
"vite/client"
],
"lib": [
"dom",
"esnext"
]
},
"exclude": [
"node_modules",
".expo",
"**/test",
"**/dist",
"**/types",
"**/__tests__"
],
}
`
));
});
}
export {
ensureTSConfig
};
//# sourceMappingURL=ensureTsConfig.js.map