I can't see why such a simple thing like exporting/importing an object/function in Js does not work as intended. Where is my error?
core.js:
import getPlugins from './plugins.js'
plugins.js:
export default () => {
return ["blah/index.js"]
}
I always get the error:
import getPlugins from './plugins.js'
^^^^^^^^^^
SyntaxError: Unexpected identifier
WTF? AFAIK I am declaring the identifier here.
So I thought that exporting the default object (as function) is easy like this.
I tried everything. module.exports =
, exporting named function:
module.exports = {
getPlugins: () => {
// ...
}
}
Please help a JS beginner. Found no answer on all the tutorials/explains I saw - or - I didn't get it at least.