Skip to content

Ability to define a function to define the libraryDirectory or the import path of the component #917

@josejulio

Description

@josejulio

I would like to define the library directory programatically. So this value would accept string | (lib: string, component: string) => string.
The use case is that the library I'm using splits into 3 folders, so depending on the requested element, this would change the path.

Ideally it would be something like:

...,
libraryDirectory: (libraryName, requiredComponent) => {
   // do stuff
   return 'dist/foobar/js';
},
....

This is something that I might be able to work on if @Brooooooklyn wants the feature in.

edit: Maybe also other configuration property and instead of returning the libraryDirectory it would return the full import path of the desired component, e.g.:

...,
componentImportPath: (libraryName, requiredComponent) => {
   // do stuff
   return 'dist/foobar/js/my_cool_component';
},
....

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions