Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: support function for loader sunch as css-loader #58 #132

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BUPTlhuanyu
Copy link

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

#58

function options like getLocalIdent cannot passed to the css-loader,so i need this function without scoped var.

Breaking Changes

Additional Info

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 19, 2021

CLA Signed

The committers listed above are authorized under a signed CLA.

@BUPTlhuanyu BUPTlhuanyu force-pushed the master branch 2 times, most recently from 53d5aed to 6c96e01 Compare December 19, 2021 09:00
@BUPTlhuanyu
Copy link
Author

Hello, this issue is a common case

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Maybe we should apply this logic for all unknown functions?

@BUPTlhuanyu
Copy link
Author

Maybe we should apply this logic for all unknown functions?

The functions with scope vars will case an error, so i take a white list of function-name.

Copy link
Author

@BUPTlhuanyu BUPTlhuanyu left a comment

Choose a reason for hiding this comment

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

support function for loader

@@ -12,6 +12,7 @@ module.exports = (env = {}) => {
poolTimeout: env.watch ? Infinity : 2000,
};
const workerPoolSass = {
workerAllowedFunctions: ['cssLoaderGetLocalIdent'],
Copy link
Member

Choose a reason for hiding this comment

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

Just idea - why do not try to make it for all functions, I understand that it will not work when it using something from global scope, but anyway it will solve other simple cases

Sorry for delay. What do you think?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants