【问题标题】:vue-service-cli build errors with file not specified未指定文件的 vue-service-cli 构建错误
【发布时间】:2019-05-22 18:20:21
【问题描述】:

在构建过程中(使用 vue-service-cli buid,通过 vue ui gui),显示以下错误,但我找不到为 src/main.ts 进行声明的位置。 vue: 2.5.21, vue-cli: 3.2.1

   ERROR  Failed to compile with 1 errors1:58:38 PM

   This relative module was not found:

   * ./src/main.ts in multi ./src/main.ts

   ERROR  Build failed with errors.

web.config.js

main.ts 在 ClientApp 中定义

       entry: { "main": "./ClientApp/main.ts" },

vue(或 webpack)是否硬连线以拥有 src 目录?

【问题讨论】:

    标签: vue.js vue-cli


    【解决方案1】:

    尝试事先清除 webpack 入口点:

    // vue.config.js
    module.exports = {
      configureWebpack: config => {
        config.entry('main')
              .clear()
              .add('./ClientApp/main.ts')
      }
    }
    

    【讨论】:

    • 谢谢,但我现在收到此错误:TypeError: config.entry is not a function。但是了解 vue 配置选项非常有帮助
    猜你喜欢
    • 2020-05-07
    • 2019-06-03
    • 1970-01-01
    • 2020-01-31
    • 2021-07-24
    • 2019-04-18
    • 1970-01-01
    • 2019-02-07
    • 2019-05-02
    相关资源
    最近更新 更多