Created
February 10, 2023 15:47
-
-
Save valentinbeggi/07041590f2c42f93def7beed83466314 to your computer and use it in GitHub Desktop.
serverless-esbuild-patch
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
diff --git a/dist/pack.js b/dist/pack.js | |
index 4582cb1ad12e8eb67843e8268674680d886feaa5..394fb9d743777d1003d4e8f53b765807cd729cfe 100644 | |
--- a/dist/pack.js | |
+++ b/dist/pack.js | |
@@ -65,10 +65,10 @@ const filterFilesForZipPackage = ({ files, functionAlias, includedFiles, exclude | |
// if no externals is set or if the provider is google, we do not need any files from node_modules | |
if (!hasExternals || isGoogleProvider) | |
return false; | |
- if ( | |
- // this is needed for dependencies that maps to a path (like scoped ones) | |
- !depWhiteList.find((dep) => (0, helper_1.doSharePath)(localPath, 'node_modules/' + dep))) | |
- return false; | |
+ // if ( | |
+ // // this is needed for dependencies that maps to a path (like scoped ones) | |
+ // !depWhiteList.find((dep) => (0, helper_1.doSharePath)(localPath, 'node_modules/' + dep))) | |
+ // return false; | |
} | |
return true; | |
}); | |
@@ -121,9 +121,7 @@ async function pack() { | |
} | |
const hasExternals = !!(externals === null || externals === void 0 ? void 0 : externals.length); | |
// get a tree of all production dependencies | |
- const packagerDependenciesList = hasExternals | |
- ? await packager.getProdDependencies(this.buildDirPath) | |
- : {}; | |
+ const packagerDependenciesList = {}; | |
const packageFiles = await (0, globby_1.default)(this.serverless.service.package.patterns); | |
// package each function | |
await Promise.all(buildResults.map(async ({ func, functionAlias, bundlePath }) => { | |
diff --git a/dist/packagers/yarn.js b/dist/packagers/yarn.js | |
index 707c4c6ff0d37f249b0b483f53bcb09ed322b962..c36c1838cabc26bccbb5faa2096cc8fc70c5e63d 100644 | |
--- a/dist/packagers/yarn.js | |
+++ b/dist/packagers/yarn.js | |
@@ -4,6 +4,9 @@ exports.Yarn = void 0; | |
const ramda_1 = require("ramda"); | |
const utils_1 = require("../utils"); | |
const semver_1 = require("semver"); | |
+const fs = require('fs'); | |
+const path = require("path"); | |
+const child_process = require("child_process"); | |
const getNameAndVersion = (name) => { | |
const atIndex = name.lastIndexOf('@'); | |
return { | |
@@ -159,9 +162,9 @@ class Yarn { | |
} | |
async install(cwd, extraArgs, useLockfile = true) { | |
const command = /^win/.test(process.platform) ? 'yarn.cmd' : 'yarn'; | |
- const args = useLockfile | |
- ? ['install', '--frozen-lockfile', '--non-interactive', ...extraArgs] | |
- : ['install', '--non-interactive', ...extraArgs]; | |
+ fs.writeFileSync(path.join(cwd, 'yarn.lock'), ''); | |
+ child_process.execSync('yarn config set enableImmutableInstalls false'); | |
+ const args = ["install", ...extraArgs]; | |
await (0, utils_1.spawnProcess)(command, args, { cwd }); | |
} | |
// "Yarn install" prunes automatically |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment