node.js es6 export / import with index.js

Viewed 8902

I have the following folder structure

src/
  index.js
  lib/
    test.js
dist/
examples/
  example.js

src/lib/test.js

export default class Test {}..

src/index.js

import App from './lib/test.js'
export default App

examples/example.js

import {App} from './../..'

=> App is undefined

How can I set my index.js as entrypoint and export my app there?

edit: I'm using babel-node as transpiler and start it with

nodemon test.js --exec babel-node --presets es2015,stage-2 --watch ./../..
2 Answers
Related