Vuejs2 如何设置别名路径?
我使用的是Vuejs2 如何设置别名路径?,vuejs2,Vuejs2,我使用的是vue cli 2.8.1 使用vue init网页包项目启动的项目 如何指定别名并使用它解析路径 例如,webpack中就是这样做的: alias: { components: path.resolve(__dirname, 'src/components/') } 这样就可以进行如下导入: import Component from 'components/component'; // note there's no './' in the path 看起来你会这么做,有什
vue cli 2.8.1
使用vue init网页包项目启动的项目
如何指定别名并使用它解析路径
例如,webpack中就是这样做的:
alias: {
components: path.resolve(__dirname, 'src/components/')
}
这样就可以进行如下导入:
import Component from 'components/component'; // note there's no './' in the path
看起来你会这么做,有什么问题吗?@thanksd,下载的启动程序中没有
webpack.config.js
,不是吗build/webpack.base.conf.js
@thanksd,哦,我没有看那里。就这样!谢谢你的帮助,先生!看起来你会这么做,有什么问题吗?@thanksd,下载的启动程序中没有webpack.config.js
,不是吗build/webpack.base.conf.js
@thanksd,哦,我没有看那里。就这样!谢谢你的帮助,先生!