Akryum / Akryum/vue-cli-plugin-apollo

Webpack Alias path is not working on apollo-server

Open
#462 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
477
Forks
109
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.