-
-
Notifications
You must be signed in to change notification settings - Fork 185
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 filter, map, reduce options #66
Conversation
Codecov Report
@@ Coverage Diff @@
## master #66 +/- ##
==========================================
- Coverage 100% 98.59% -1.41%
==========================================
Files 2 2
Lines 56 71 +15
==========================================
+ Hits 56 70 +14
- Misses 0 1 +1
Continue to review full report at Codecov.
|
9cf27b2
to
0b413f8
Compare
spec/plugin.spec.js
Outdated
}, { | ||
manifestOptions: { | ||
filter: function(entry) { | ||
return entry.isInitial; |
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.
@a-x- Does that looks good to you?
0b413f8
to
d7b759c
Compare
c67c494
to
9f743c4
Compare
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.
Minor changes will be good.
Looks good to me at all.
README.md
Outdated
|
||
Type: `function` | ||
|
||
Filter out files. |
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.
I think will be cool to add examples here and below:
e.g.
// #48 Include initial chunks only (w/o dynamic dependencies)
filter: ({chunk, file}) => {
return chunk.isInitial();
}
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.
I don't know, I don't really want to pollute the readme too much...
spec/plugin.spec.js
Outdated
manifestOptions: { | ||
reduce: function (manifest, file) { | ||
manifest[file.name] = { | ||
file:file.path, |
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.
:<space>
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.
are we need eslint in CI?
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.
We definitely need to setup eslint as some point
I personally have a preference for https://github.com/sindresorhus/xo , but really I don't mind ;)
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.
is xo like prettier?
README.md
Outdated
|
||
Type: `function` | ||
|
||
Create the manifest. It must return an `Object`. The default one will take the name of the chunk as a key and the path of the file as the value. |
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.
As I understand, we should note here: «custom reduce opt function replaces that default reduce
logic:
function (manifest, file) {
manifest[file.name] = file.path;
return manifest;
}
lib/plugin.js
Outdated
manifest = files.reduce(function (manifest, file) { | ||
manifest[file.name] = file.path; | ||
return manifest; | ||
}, {}); |
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.
use seed
instead of {}
closes #46
closes #55
closes #35