Closed tsingson closed 2 years ago
errro info like:
[plugin:vite:import-analysis] Failed to resolve import "@/config/config" from "src/apktype/hooks/asyncApktypeAction.ts". Does the file exist? [/Users/qin.....................e/hooks/asyncApktypeAction.ts:6:0]() 3 | import request from "umi-request"; 4 | import { getApktpeListApi } from "./hooks"; 5 | import { baseURL } from "@/config/config"; | ^ 6 | const oneAtom = atom(false); 7 | export const asyncApktypeAction = () => { ....
tsconfig
{ "compilerOptions": { "target": "ESNext", "lib": ["DOM", "DOM.Iterable", "ESNext"], "types": ["vite/client", "node"], "allowJs": false, "skipLibCheck": true, "esModuleInterop": false, "allowSyntheticDefaultImports": true, "strict": false, "forceConsistentCasingInFileNames": true, "module": "ESNext", "moduleResolution": "Node", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", "baseUrl": ".", "paths": { "*": ["node_modules/*"], "@/*": ["src/*"] } }, "include": ["src", "vite.config.ts", "cypress"] }
vite config
import react from "@vitejs/plugin-react"; import { resolve } from "path"; import { visualizer } from "rollup-plugin-visualizer"; import { UserConfig } from "vite"; import Checker from "vite-plugin-checker"; function pathResolve(dir: string) { return resolve(__dirname, ".", dir); } const shouldAnalyze = process.env.ANALYZE; const config: UserConfig = { resolve: { alias: [ { find: /@\//, replacement: pathResolve("src") + "/" } ] }, build: { rollupOptions: { plugins: !!shouldAnalyze ? [visualizer({ open: true, filename: "./bundle-size/bundle.html" })] : [] }, sourcemap: !!shouldAnalyze }, css:{ preprocessorOptions:{ less: { javascriptEnabled: true, } } }, plugins: [ react({}), Checker({ typescript: true, overlay: true, eslint: { files: "src", extensions: [".ts", ".tsx"] } }) ], }; const getConfig = () => config; export default getConfig;
it's a bug ?
duplicate https://github.com/tajo/ladle/issues/59
errro info like:
tsconfig
vite config
it's a bug ?