Open tree sharing in ember-cli add-on

I am completely puzzled when I read all the information I can collect about sharing the public resource directory from the ember-cli .

Is there anyone who works here? Any reference to an exemplary addon executing it would also be appreciated ...

+5
source share
1 answer

So ... I finally found a way to share static assets: - I put the files in the vendor/assets directory - Files for sharing (each file ...) are index.js in the addon index.js file @addon root

 app.import('vendor/assets/my_image.png'); 

An interesting version of the app.import operator, which I found in my search queries, is destDir , which allows destDir to configure the publication target path to the resource:

 app.import('vendor/assets/a/b/c/my_image.png', { destDir: 'x/y' }); 

will post my_image.png @URL /assets/x/y/my_image.png

Hoping this helps others save time ...

+6
source

Source: https://habr.com/ru/post/1208653/


All Articles