【taro+react】taro设置路径别名
1.找到项目根目录config/index.js2.添加以下内容const path = require('path')const config = {alias: {'@actions': path.resolve(__dirname, '..', 'src/actions'),'@assets': path.resolve(__dirname, '..', 'src/assets'),'@co
·
1.找到项目根目录config/index.js
2.添加以下内容
const path = require('path')
const config = {
alias: {
'@actions': path.resolve(__dirname, '..', 'src/actions'),
'@assets': path.resolve(__dirname, '..', 'src/assets'),
'@components': path.resolve(__dirname, '..', 'src/components'),
'@constants': path.resolve(__dirname, '..', 'src/constants'),
'@reducers': path.resolve(__dirname, '..', 'src/reducers'),
'@styles': path.resolve(__dirname, '..', 'src/styles'),
'@utils': path.resolve(__dirname, '..', 'src/utils'),
'@network': path.resolve(__dirname, '..', 'src/network')
},
xxxxxxx
xxxxxxx
}
个人网站:沉默博客
如有错误,请多多指教。
如对你有帮助,给个赞吧。
更多推荐
已为社区贡献1条内容
所有评论(0)