Akryum / Akryum/vue-cli-plugin-apollo

Webpack Alias path is not working on apollo-server

未关闭
#462 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
477
派生
109
PR 合并指标
30 天内没有已合并 PR

描述

vue-cli default config for webpack is including this.
```
config.resolve.alias.set('@', path.resolve(__dirname, './src/'))
```
so I use @ in import on the client-side. It is working perfectly
```
import { Role } from '@/utils/enum'
```
but when I use it in apollo-server (i use it in data-sources.js)
It is not working. I got error msg like this.
```
projectDir\node_modules\@vue\cli-service\bin\vue-cli-service.js
at Object. (projectDir\apollo-server\data-sources.js:1) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'projectDir\\apollo-server\\data-sources.js',
'projectDir\\node_modules\\vue-cli-plugin-apollo\\utils\\load.js',
'projectDir\\node_modules\\vue-cli-plugin-apollo\\graphql-server\\index.js',
'projectDir\\node_modules\\vue-cli-plugin-apollo\\index.js',
'projectDir\\node_modules\\@vue\\cli-service\\lib\\Service.js',
'projectDir\\node_modules\\@vue\\cli-service\\bin\\vue-cli-service.js'
]
}
```
Is it a bug?
If not, pls tell me how to config alias for apollo-server.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。