vendredi 7 août 2020

How to write modules in vendor ember folder?

I'm trying to write modules in vendor folder.

// vendor/my-tool/index.js
import { a } from './animations.js'
alert(1);
// vendor/my-tool/animations.js
export const a = 1;

Then import them like this:

app.import('vendor/my-tool/index.js');

But I get these errors:

Uncaught SyntaxError: import declarations may only appear at top level of a module Uncaught 
ReferenceError: define is not defined

I've all trying to fix them. Maybe, applying babel to vendor files could make it work, but I did not find the way. How can I do it?




Aucun commentaire:

Enregistrer un commentaire