Meteor-feature-requests: Allow Absolute Imports Without Leading "/"

Created on 3 Nov 2017  路  3Comments  路  Source: meteor/meteor-feature-requests

Having a "/" for absolute imports is different from how it's typically done in Webpack & is causing issues in text editors like VSCode.

Works with Meteor but not VSCode:

import { getProduct } from '/imports/api/products/methods';

Works with VSCode but not Meteor:

import { getProduct } from 'imports/api/products/methods';

Most helpful comment

I haven't tried it but I think you can do that with babel-plugin-module-resolver.

All 3 comments

I haven't tried it but I think you can do that with babel-plugin-module-resolver.

Can confirm that this works. Thanks!

I should note though that this breaks with dynamic imports.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mitar picture mitar  路  34Comments

SachaG picture SachaG  路  50Comments

mitar picture mitar  路  65Comments

Firfi picture Firfi  路  33Comments

scharf picture scharf  路  118Comments