-
Notifications
You must be signed in to change notification settings - Fork 416
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
fix excludeRegex by actually excluding files #777
Conversation
Thanks for providing that fix. But after testing the module.configuration = new Configuration({
webpack: {
excludeRegex: /.*/
}
}); So the test is working. Configuration {
_config: {
excludeRegex: /.*/,
webpackConfig: 'webpack.config.js',
includeModules: false,
packager: 'npm',
packagerOptions: {},
keepOutputDirectory: false,
config: null,
concurrency: 4
},
_hasLegacyConfig: false
} But when defining the regex in module.configuration = new Configuration({
webpack: {
excludeRegex: '/.*/'
}
}); And in that case, test are failing. Configuration {
_config: {
excludeRegex: '/.*/',
webpackConfig: 'webpack.config.js',
includeModules: false,
packager: 'npm',
packagerOptions: {},
keepOutputDirectory: false,
config: null,
concurrency: 4
},
_hasLegacyConfig: false
} I tried to use new RegExp(this.configuration.excludeRegex) Do you have an idea on how to fix it? |
As you created your PR on your master branch, I can't force push on it. So I created an other PR, cherry-picked your commit and applying some changes. Go check it #780 |
@j0k3r Yeah, sorry I didn't pay enough attention to that. I think you should omit the slashes around the actual regular expression if you declare it as a string in serverless.yml. Then you can pass this string into So, just define the I can do a separate PR with these changes if you'd like. |
I finally did it in #780, can you have a look? |
I started getting spawn E2BIG on sls package in bestzip where it shells out (nativeZip()) with a very long command line that I would expect to be very different if it was actually using * instead? All the individual files that serverless need to pack in my list of dependencies go over 2x of allowed Downgrade to 5.4.0 solved the problem. I will post a separate issue to make it easier to track. |
What did you implement:
Closes #776
How did you implement it:
glob
, add anodir: true
parameter to have only actual files in the resultingfiles
array.excludeRegex
option if specified. If verbose, log the amount of excluded files.bestzip
, passfiles
instead of"*"
so that only specified files end up in the zip.How can we verify it:
webpack.config.js
excludeRegex
:/.*\.map/
Before:
After:
Todos:
Is this ready for review?: YES
Is it a breaking change?: NO
P.S. I had to add an additional missing undefined-check in
lib/wpwatch.js
to pass 3 failing unit tests.