Skip to content

Added attributes to the Config #18

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

Merged
merged 4 commits into from
Nov 27, 2019
Merged

Conversation

hamidadelyar
Copy link

Hey,

Really appreciate this package, great work!
Made a small tweak to allow attributes for the <style> tag rather than assuming type="text/css"

Let me know what you think!

Thanks,

Hamid

Copy link
Owner

@runjuu runjuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! 👍

@runjuu runjuu self-assigned this Nov 21, 2019
@runjuu
Copy link
Owner

runjuu commented Nov 22, 2019

Hi @hamidadelyar ,I realized that there is a problem with object type of attributes. We can't add attributes for specific file. How about change the signature to

{
  attributes?(fileName: string): { [name: string]: string }
}

@hamidadelyar
Copy link
Author

Hi @hamidadelyar ,I realized that there is a problem with object type of attributes. We can't add attributes for specific file. How about change the signature to

{
  attributes?(fileName: string): { [name: string]: string }
}

@hamidadelyar
Copy link
Author

Hi @hamidadelyar ,I realized that there is a problem with object type of attributes. We can't add attributes for specific file. How about change the signature to

{
  attributes?(fileName: string): { [name: string]: string }
}

@hamidadelyar hamidadelyar reopened this Nov 25, 2019
@hamidadelyar
Copy link
Author

Hi @hamidadelyar ,I realized that there is a problem with object type of attributes. We can't add attributes for specific file. How about change the signature to

{
  attributes?(fileName: string): { [name: string]: string }
}

Hey @runjuu,

I'm not entirely sure what you mean. Do you mean changing the Config in types.ts to this?

export interface Config {
  filter?(fileName: string): boolean
  leaveCSSFile?: boolean
  replace?: ReplaceConfig
  attributes?(fileName: string): { [name: string]: string }
}

I'm not entirely sure what this does, also typescript complains about it.

Feel free to make the change :)

@runjuu runjuu changed the base branch from master to feat/attributes November 27, 2019 10:57
@runjuu
Copy link
Owner

runjuu commented Nov 27, 2019

Hi @hamidadelyar , I will merge the PR into feat/attributes branch first and make some changes before release.

@runjuu runjuu merged commit f5e4af9 into runjuu:feat/attributes Nov 27, 2019
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.

3 participants