1.配置
config/index.js
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') }, }
.