独立运行无服务器模板Webpack构建

时间:2019-05-23 11:19:40

标签: node.js webpack serverless-framework

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

  • webpack-版本4.32.0
  • npm-版本6.9.0
  • 无服务器-版本1.43.0

serverless create --template aws-nodejs-typescript

从这里开始,serverless deploy(以及其他命令)有效,但是

  

webpack

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]

1 个答案:

答案 0 :(得分:0)

看起来无Webpack的webpack的使用不是标准的webpack配置。您可以直接使用serverless package而不是webpack。

相关问题