We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
新建 jsconfig.json, 方便编辑器代码跳转,对构建无意义
jsconfig.json
{ "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["src/*"] } }, "exclude": ["node_modules"], "include": ["src/**/*"] }
在 tsconfig.json 中配置 paths
tsconfig.json
paths
"compilerOptions": { "paths": { "@/*":["./src/*"] } }
webpack.config.js 配置 resolve
webpack.config.js
resolve
resolve: { alias: { '@': path.resolve('src'), }, },
vite.config.js中配置 resolve
vite.config.js
resolve: { alias: { "@": path.resolve(__dirname, 'src') } }
下载插件babel-plugin-module-resolver,在 babel.config.js中配置
babel-plugin-module-resolver
babel.config.js
module.exports = { presets: ['module:metro-react-native-babel-preset'], plugins: [ [ 'module-resolver', { alias: { '@': './src', }, }, ], ], }
The text was updated successfully, but these errors were encountered:
在windows 上换行符会出现这个问题,配置 规则即可
'prettier/prettier': [ 'error', { endOfLine: 'auto', }, ],
Sorry, something went wrong.
No branches or pull requests
别名配置
JS配置
新建
jsconfig.json
, 方便编辑器代码跳转,对构建无意义TS配置
在
tsconfig.json
中配置paths
Webpack配置
webpack.config.js
配置resolve
Vite 配置
vite.config.js
中配置resolve
Babel配置(RN使用时)
下载插件
babel-plugin-module-resolver
,在babel.config.js
中配置The text was updated successfully, but these errors were encountered: