const isServerRenderer = name === 'server-renderer'
const isNodeBuild = format === 'cjs'
const isGlobalBuild = /global/.test(format)
- const isCompatPackage = pkg.name === '@vue/compat'
+ const isCompatPackage =
+ pkg.name === '@vue/compat' || pkg.name === '@vue/compat-canary'
const isCompatBuild = !!packageOptions.compat
const isBrowserBuild =
(isGlobalBuild || isBrowserESMBuild || isBundlerESMBuild) &&
// we are bundling forked consolidate.js in compiler-sfc which dynamically
// requires a ton of template engines which should be ignored.
let cjsIgnores = []
- if (pkg.name === '@vue/compiler-sfc') {
+ if (
+ pkg.name === '@vue/compiler-sfc' ||
+ pkg.name === '@vue/compiler-sfc-canary'
+ ) {
cjsIgnores = [
...Object.keys(consolidatePkg.devDependencies),
'vm',
['view', `${pkgName}@~${canaryVersion}`, 'version', '--json'],
{ stdio: 'pipe' }
)
- const versions = JSON.parse(stdout)
+ let versions = JSON.parse(stdout)
+ versions = Array.isArray(versions) ? versions : [versions]
const latestSameDayPatch = /** @type {string} */ (
semver.maxSatisfying(versions, `~${canaryVersion}`)
)
canaryVersion = /** @type {string} */ (
semver.inc(latestSameDayPatch, 'patch')
)
- } catch (e) {}
+ } catch (e) {
+ if (/E404/.test(e.message)) {
+ // the first patch version on that day
+ } else {
+ throw e
+ }
+ }
targetVersion = canaryVersion
}