Closed jcompagner closed 1 year ago
I will consider your solution, but for the time being (as I mentioned in the README) you can use this line for the css:
@import '../node_modules/@ali-hm/angular-tree-component/css/angular-tree-component.css';
make the relational path based on the file that you are importing the "angular-tree-component.css".
ah no, that is horrible for us, because that path can be quite specific, can be a parent of a parent node modules... if you ship stuff in the package there just needs to be a export entry in the package.json
It is resolved in v12.0.4. Now you can import css using this line:
@import '@ali-hm/angular-tree-component/css/angular-tree-component.css';
I see you copy the "css" file to the root: /css/angular-tree-component.css
also ng-packages also has it as an asset (i guess you can remove that line?) https://github.com/ali-hm/angular-tree-component/blob/master/projects/angular-tree-component/ng-package.json#L4
Because that for some reason does include it, but doesn't include it in the package.json exports list it seems that you really need todo that in the package.json of the project:
https://github.com/ng-packagr/ng-packagr/blob/main/docs/copy-assets.md
so on this line: https://github.com/ali-hm/angular-tree-component/blob/master/projects/angular-tree-component/package.json#L47
we need:
"exports": { "./css/angular-tree-component.css": { "style": "./css/angular-tree-component.css" } }
so that it will compile because else if i include that lib and it try to import that css in my own:
@import '@ali-hm/angular-tree-component/css/angular-tree-component.css';
then i get:
Error: Package path ./css/angular-tree-component.css is not exported from packagenode_modules\@ali-hm\angular-tree-component (see exports field in \node_modules\@ali-hm\angular-tree-component\package.json)