Skip to content

add ability to use a default function for modules#34

Merged
hipstersmoothie merged 6 commits into
intuit:masterfrom
enzozafra:defaultModulesFunction
Oct 6, 2020
Merged

add ability to use a default function for modules#34
hipstersmoothie merged 6 commits into
intuit:masterfrom
enzozafra:defaultModulesFunction

Conversation

@enzozafra

@enzozafra enzozafra commented Oct 5, 2020

Copy link
Copy Markdown

What Changed

Add a default function to use for modules. I made an assumption that the default to be used is the function that was in the README. This is:

const defaultLocalizeFunction = (
  name: string,
  filePath: string,
  css: string
) => {
  const hash = crypto
    .createHash('md5')
    .update(css)
    .digest('hex')
    .slice(0, 6);
  return `${filePath || 'default'}-${name}-${hash}`;
}

I updated the README to reflect how to use this default function and replaced the 'custom' function in the README to avoid confusion.

Why

#25

Todo:

  • Add tests
  • Add docs
  • Add yourself to contributors (run yarn contributors:add)

@enzozafra

Copy link
Copy Markdown
Author

Seems to be some token issue for the last stage of CircleCI. Let me know if I need to do anything about it!

@hipstersmoothie hipstersmoothie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks pretty good! just some docs updates and I can merge this

Comment thread README.md
@hipstersmoothie hipstersmoothie added the minor Increment the minor version when merged label Oct 6, 2020
@hipstersmoothie hipstersmoothie merged commit 9fd9f48 into intuit:master Oct 6, 2020
@hipstersmoothie

Copy link
Copy Markdown
Contributor

🚀 PR was released in v2.1.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest minor Increment the minor version when merged released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants