Reputation:
I created a new project with the Aurelia cli but when I want to import a personnal library, the consol return an Unexpected token error.
I followed the Adding Client Libraries to Your Project Tutorial.
This is my library code :
export function hello{
console.log("hello");
}
And in the aurelia.json file I added a new entry :
{
"name": "hello",
"path": "../scripts/hello"
},
I think this is a configuration problem in the transpiler entry, but i didn't find any informations.
"transpiler": {
"id": "babel",
"displayName": "Babel",
"fileExtension": ".js",
"options": {
"plugins": [
"transform-es2015-modules-amd"
]
},
"source": "src/**/*.js"
},
Upvotes: 1
Views: 839
Reputation: 1257
In my opinion, bundles.dependencies
section of aurelia.json
should be used for external libraries already transpilled to ES5 format.
src/
folder, so it would be transpilled along with the rest of your source code.In the latter case, Aurelia Skeleton Plugin may give you fresh ideas. It is configured to provide multiple output formats.
Upvotes: 1