Skip to content

[BUG] entry 配置必须写明文件后缀  #924

@xiaohuoni

Description

@xiaohuoni

https://github.com/umijs/father/blob/b1b4ca71f52e912e28395272dc833a4cc39bbb61/src/builder/bundle/mako.ts#L46

father 中这样设置 entry

entry: {
      [path.parse(config.output.filename).name]: path.join(
        opts.cwd,
        config.entry,
      ),
    },

运行时的数据大致如下:

const { build, dev } = require(process.env.OKAM);
build({
  entry: {
    'index.min': '/Users/congxiaochen/Documents/father/examples/normal/src/index'
  }
})
Load config failed: entry:index.min not found
error - [Error: Build with mako failed.]

手动写上后缀

const { build, dev } = require(process.env.OKAM);
build({
  entry: {
    'index.min': '/Users/congxiaochen/Documents/father/examples/normal/src/index.tsx'
  }
})

项目可以正常执行构建

basic optimize in 0ms.
dist/index.min.js       145.57 kB │ map: 351.88 kB
✓ Built in 181ms
Complete!

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