Closed Junyan closed 4 years ago
webpack alias 配置: '@common/components': 'src/common/components'
'@common/components': 'src/common/components'
因为项目中有各种各样的引用方式,引用到src/common/components/index.js导致无法按需引入。
src/common/components/index.js
import { Icon } from '../'; import { Icon } from '../index'; import { Icon } from '../components'; import { Icon } from '@common/components'; import { Icon } from '@common/components/index';
希望支持本地路径,这样上方的引用路径,都能通过插件转成如下形式:
import Icon from '@common/components/Icon';
webpack alias 配置:
'@common/components': 'src/common/components'
因为项目中有各种各样的引用方式,引用到
src/common/components/index.js
导致无法按需引入。希望支持本地路径,这样上方的引用路径,都能通过插件转成如下形式: