Closed JkmAS closed 6 years ago
This issue as been imported as question since it does not respect express-template issue template. Only bug reports and feature requests stays open to reduce maintainers workload. If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically. Your question is available at https://cmty.app/nuxt/express-template/issues/c108.
Since there is no backpack anymore, you can't use ES6 Modules in express
No, I am using nuxt-edge (check this link https://medium.com/nuxt/nuxt-2-is-coming-oh-yeah-212c1a9e1a67#5234 -- Nuxt ES modules). So the question isn't related to using ES6 modules.
I have an issue with aliases. They don't work in server code. Maybe it's issue for nuxt-edge, I don't know.
Hi, I am using
nuxt-edge
withexpress
server via nuxt.config.jsserverMiddleware
and I want to use aliases (~
,~~
) in imports in the same way as on the frontend (e. g. in vue templates).Is it even possible to use them? Because in this repo they are not used https://github.com/nuxt-community/express-template/blob/master/template/api/index.js#L7.
Thanks
If I use alias, the nuxt throws an error
Cannot find module '~/router/router'
.Works:
import router from './router/router';
Doesn't workimport router from '~/router/router';
express.js index file
nuxt.config.js