From 0e1d9cf869139a73943156a7dbc2a3efc1be6670 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 22 Dec 2020 18:46:36 +0100 Subject: [PATCH] chore: fix edge build [release] --- scripts/package.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/package.js b/scripts/package.js index 0bfe8c165c..74eedd80e3 100644 --- a/scripts/package.js +++ b/scripts/package.js @@ -125,6 +125,10 @@ export default class Package { // Apply suffix to all linkedDependencies if (this.pkg.dependencies) { for (const oldName of (this.options.linkedDependencies || [])) { + if (!this.pkg.dependencies[oldName]) { + continue + } + const name = oldName + this.options.suffix const version = this.pkg.dependencies[oldName] || this.pkg.dependencies[name] @@ -278,8 +282,9 @@ export default class Package { throw new Error(`Missing dependencies in ${this.pkg.name}: ` + missingDependencies.join(', ')) } const ignoreUnused = this.options.ignoreUnused || [] + const stripEdge = s => s.replace(/-edge$/, '') const unusedDependencies = dependencies.filter(d => - !imports.find(i => i.startsWith(d)) && !ignoreUnused.includes(d) + !imports.find(i => i.startsWith(d)) && !ignoreUnused.includes(stripEdge(d)) ) if (unusedDependencies.length) { throw new Error(`Unused dependencies in ${this.pkg.name}: ` + unusedDependencies.join(', '))