Is it possible to integrate CLI library into non-CLI project


#1

Hi,

I have a non-cli ember project. It is a large app, so porting to CLI needs a lot of refactoring. Therefor I would like to leave it as it. Is it possible to integrate CLI libraries into non-cli project?

Thanks.


#2

Depends on what tools your project has. Cli addons use ES6 module syntax, so the answer will depend a lot on whether you non-cli project uses a transpiler or not. If not, I don’t think you will be able to use it (though you might check whether it is possible to build the addon as a standalone bundle)

If you do have a transpiler, addon code lives in the addon/ subdir. I guess you should be able to either add the some-library/addon directory to your import lookup path, or just add a link to it in your project.

You will have to manage dependencies manually though. I guess it is okay for a one-off lib, but don’t make it a common practice, maintenance will be a nightmare.