-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: add custom parameter names for wrapper args #86
feat: add custom parameter names for wrapper args #86
Conversation
Codecov Report
@@ Coverage Diff @@
## master #86 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 183 189 +6
Branches 67 68 +1
=========================================
+ Hits 183 189 +6
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update docs
Hi @evilebottnawi . Updated the README. |
@@ -1169,7 +1169,7 @@ exports[`loader should work with the "wrapper" options as an object notation: er | |||
exports[`loader should work with the "wrapper" options as an object notation: module 1`] = ` | |||
"/*** IMPORTS FROM imports-loader ***/ | |||
|
|||
(function(myGlobalVariable, myOtherGlobalVariable) { | |||
(function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it was changed? We should not change other tests, otherwise it is the breaking change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it. It was a bug. 😅
8cccb11
to
86162a7
Compare
@@ -56,19 +56,29 @@ export default function loader(content, sourceMap) { | |||
if (typeof options.wrapper !== 'undefined') { | |||
let thisArg; | |||
let args; | |||
let params; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let params = '';
And remove params = '';
from boolean
/string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for delay, let's merge as is
This PR contains a:
Motivation / Use-Case
I wanted to create a wrapper like this: https://github.com/google/shaka-player/blob/master/build/wrapper.template.js where it should be possible for me where arguments and parameters have different names.
The current loader is perfect for the use case: it has hook for
additionalCode
as well aswrapper
. This PR adds the only missing functionality: differing names.Breaking Changes
None.
Additional Info
None.