【taro react】---- 配置目录别名
2023-09-14 09:15:07 时间
1. 官方文档
2. 相对路径
使用相对路径书写文件引用如下:
import RuiModal from "../../components/RuiModal/RuiModal";
import RuiOverlay from "../../components/RuiOverlay/RuiOverlay";
3. 配置目录别名
为了避免书写多级相对路径,我们可以如下配置 alias:
/config/index.js
const config = {
// ...
alias: {
"@src": path.resolve(__dirname, "..", "src"),
"@css": path.resolve(__dirname, "..", "src/css"),
"@com": path.resolve(__dirname, "..", "src/component"),
"@utils": path.resolve(__dirname, "..", "src/utils"),
}
}
module.exports = function (merge) {
if (process.env.NODE_ENV
相关文章
- react开发教程(六)React与DOM
- React系列——websocket群聊系统在react的实现
- hibernate配置详情4(TestUtil.java)
- Debian下配置SSH服务器的方法
- Java虚拟机详解03----常用JVM配置参数
- [React Testing] Test your Custom Hook Module with react-hooks-testing-library
- [React Testing] Test react-router-dom Router Provider with createMemoryHistory
- [React Intl] Install and Configure the Entry Point of react-intl
- [React] Ensure all React useEffect Effects Run Synchronously in Tests with react-testing-library
- [React Intl] Render Content Based on a Number using react-intl FormattedMessage (plural)
- zookeeper的安装及配置教程(步骤详尽)
- [ASP.NET Core 3框架揭秘] 配置[9]:自定义配置源
- React的source code init时会自动检测Chrome dev tool的react extension装了没
- atitit.React 优缺点 相比angular react是最靠谱的web ui组件化方案了
- 44.第十章 网络协议和管理配置 -- TCP/IP 协议栈(五)
- 伪基站,卒于5G——本质上是基于网络和UE辅助的伪基站检测,就是将相邻基站的CI、信号强度等信息通过测量报告上报给网络,网络结合网络拓扑、配置信息等相关数据,对所有数据进行综合分析,确认在某个区域中是否存在伪基站
- Python 小白从零开始 PyQt5 项目实战(1)安装与环境配置
- Centos8 配置IP地址与配置阿里YUM源
- [spring学习]6、基于注解配置bean
- 【taro react】---- VSCode 配置用户代码片段
- react 集成baidu ai 获取token 配置代理
- AlertManager告警分配路由配置(十)