Skip to content

[Bug report] 1.0.0-alpha.40 breaks #1204, #1206 #1362

Closed
@meteorlxy

Description

@meteorlxy
  • I confirm that this is a issue rather than a question.

Bug report

Version

1.0.0-alpha.40

Steps to reproduce

d16d3d5#diff-56a897e96a354a8b8ea86dc24074ad5bR61

    const pkgPath = require.resolve(name)
    let packageRootDir = parse(pkgPath).dir
    // For those cases that "main" field was set to non-index file
    // e.g. `layouts/Layout.vue`
    while (!fs.existsSync(`${packageRootDir}/package.json`)) {
      packageRootDir = resolve(packageRootDir, '..')
    }

What is expected?

Allow "main" field to be set to something like lib/index.js (As explained in #1204 )

In such case, the packageRootDir should be <pkgDir>/lib/

What is actually happening?

The packageRootDir is <pkgDir> now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions