node.js - 运行无服务器模板 Webpack 独立构建

标签 node.js webpack serverless-framework

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

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

无服务器创建 --template aws-nodejs-typescript

从这里开始,无服务器部署可以工作(以及任何其他命令),但是

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]

最佳答案

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

关于node.js - 运行无服务器模板 Webpack 独立构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56274094/

相关文章:

mysql - 如何使用diesel和mysql调用/部署无服务器功能?

node.js - 在 Node JS 请求中发送未解析的数据

typescript - webpack-dev-server 需要永远加载包

javascript - webpack 4 react 意外 token ...(扩展运算符)

javascript - Webpack 4、postcss-loader 和 autoprefixer 插件

python - 如何在无服务器 Lambda (Python) 中下载 S3 文件

go - 云功能CPUMilliSeconds配额已超出

json - 如何在 package.json 中拥有来自不同注册表的 npm 依赖项?

javascript - 双倍回调! Node.js Chai

sql-server - 许多更新出现死锁错误