This is our project structure:
- project
- a.js
- b.js
In a.js I want to import b.js file using root path in the way like this:
import c from '~/b.js';
but not using relative path like this:
import c from '../b.js';
We are using native esmodule, not Babel or Webpack or something, so is there any way?
'./b.js'
(a relative path in the same directory) or just'b.js'
(a name to be resolved by nodejs anywhere). – Sequester