Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export style from lib #25

Merged
merged 2 commits into from
Feb 5, 2024
Merged

Conversation

rengert
Copy link
Contributor

@rengert rengert commented Feb 2, 2024

This pr helps users importing you style directly in a scss without point to a single file in node module.
I added two ways for the people

example 1

@import 'ngx-loading-buttons/styles';

example 2

@import 'ngx-loading-buttons/styles.css';

I updated the readme as well.
For testing you could copy dist to node modules because the setting in the ts config is not working here.

@dkreider
Copy link
Owner

dkreider commented Feb 2, 2024

Hey @rengert, thanks for the PR! 👏🏻

Any idea why I get this error when I try testing the new changes?

image

If you take a look at the projects/ngx-loading-buttons/schematics folder you'll notice that when a user installs with ng add that the schematics automatically import the required styles file.

@rengert
Copy link
Contributor Author

rengert commented Feb 2, 2024

I am not using the schematic because it seems not working for nx workspace:

TypeError: Cannot read properties of undefined (reading 'map')
at /Users/tomfila/Documents/Development/jira/Bolzplatzarena/node_modules/ngx-loading-buttons/schematics/ng-add/setup.js:38:39

Additionally there were linting rules implemented that do not allow access files not exported from libs.

That why added the additional exports, for it would be fine to leave the schematic as it is :) but i guess i need to update the readme, that this is an optional step if ng add is not used.

As written for testing i copied the package to node modules because the css loader in my case does not respect the setting in tsconfig to map the package name to the dist folder. Without this a face exactly the same message

@dkreider
Copy link
Owner

dkreider commented Feb 5, 2024

Gotcha, that makes sense. I'll merge. Thanks for the contribution. 👏🏻

@dkreider dkreider merged commit 7b54725 into dkreider:main Feb 5, 2024
1 check passed
Totto16 added a commit to Totto16/ngx-loading-buttons that referenced this pull request Oct 24, 2024
this was added incorrectly in dkreider#25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants