【问题标题】:Running Serverless template Webpack build standalone运行无服务器模板 Webpack 独立构建
【发布时间】:2019-05-23 20:28:59
【问题描述】:

我开始使用无服务器,我想知道为什么不通过无服务器框架就无法运行 Webpack 构建

  • webpack --version 4.32.0
  • npm --version 6.9.0
  • 无服务器 --version 1.43.0

serverless create --template aws-nodejs-typescript

从这里,serverless deploy 工作(和任何其他命令)但是

网络包

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.entry should be one of these:
   function | object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string]
   -> The entry point(s) of the compilation.
   Details:
    * configuration.entry should be an instance of function
      -> A Function returning an entry object, an entry string, an entry array or a promise to these things.
    * configuration.entry should not be empty.
      -> Multiple entry bundles are created. The key is the chunk name. The value can be a string or an array.
    * configuration.entry should be a string.
      -> An entry point without name. The string is resolved to a module which is loaded upon startup.
    * configuration.entry should be an array:
      [non-empty string]

【问题讨论】:

    标签: node.js webpack serverless-framework


    【解决方案1】:

    看起来 webpack serverless 使用的不是标准的 webpack 配置。你可以直接用serverless package代替webpack。

    【讨论】:

      猜你喜欢
      • 2015-11-23
      • 2017-09-03
      • 1970-01-01
      • 2016-12-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-09
      • 2018-02-16
      相关资源
      最近更新 更多