Open
Conversation
Collaborator
|
Globby matches are supported in 4.0 but gave not been released yet. Although the regex match there currently should let you exclude some files. |
adam-gipril
reviewed
Nov 18, 2020
Comment on lines
36
to
+37
| assetMatch: Joi.string().default('**'), | ||
| ignoreMatch: Joi.string().default(''), |
There was a problem hiding this comment.
This could also be done by allowing assetMatch to be an array (I just did it like that locally before I had seen this PR).
Suggested change
| assetMatch: Joi.string().default('**'), | |
| ignoreMatch: Joi.string().default(''), | |
| assetMatch: [Joi.string().default('**'), Joi.array().items(Joi.string())], |
@nicekiwi looks like even at the current package.json globby version of 8.0.1, the globby.sync method can accept an array of patterns. I tested the change I've suggested locally, and it works with the following to upload all but my map files. Any estimate on when something like this could be merged and released?
pluginOptions: {
s3Deploy: {
assetMatch: ['**', '!(**/*.map)'],
}
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
In my current project we use rollbar-sourcemap-webpack-plugin, this plugin generate and upload .js.map files on build process. All .js.map files is recommended to no be public:

I believe this is a common pattern and other projects should have the same problem
Workaround
For now before of
npm run deploywe runningrm -R dist/js/*.mapbut I believe this should be the responsibility of the deploy tool.Solution
Add another optional config (
ignoreMatch) to permit ignore some files based on Globbing patterns.I think this config should be as default something like
!**/*.map, but to not generate break change, suggest the default as an empty string for now.