chore: fix edge build [release]

This commit is contained in:
Pooya Parsa 2020-12-22 18:46:36 +01:00
parent 108cd8216a
commit 0e1d9cf869

View File

@ -125,6 +125,10 @@ export default class Package {
// Apply suffix to all linkedDependencies // Apply suffix to all linkedDependencies
if (this.pkg.dependencies) { if (this.pkg.dependencies) {
for (const oldName of (this.options.linkedDependencies || [])) { for (const oldName of (this.options.linkedDependencies || [])) {
if (!this.pkg.dependencies[oldName]) {
continue
}
const name = oldName + this.options.suffix const name = oldName + this.options.suffix
const version = this.pkg.dependencies[oldName] || this.pkg.dependencies[name] 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(', ')) throw new Error(`Missing dependencies in ${this.pkg.name}: ` + missingDependencies.join(', '))
} }
const ignoreUnused = this.options.ignoreUnused || [] const ignoreUnused = this.options.ignoreUnused || []
const stripEdge = s => s.replace(/-edge$/, '')
const unusedDependencies = dependencies.filter(d => 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) { if (unusedDependencies.length) {
throw new Error(`Unused dependencies in ${this.pkg.name}: ` + unusedDependencies.join(', ')) throw new Error(`Unused dependencies in ${this.pkg.name}: ` + unusedDependencies.join(', '))