node.js - 运行无服务器模板 Webpack 独立构建
问题描述
我开始使用无服务器,我想知道为什么不经过无服务器框架就无法运行 Webpack 构建
- webpack --版本 4.32.0
- npm --版本 6.9.0
- 无服务器——版本 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]
解决方案
看起来 webpack 无服务器使用不是标准的 webpack 配置。您可以serverless package
直接使用而不是 webpack。
推荐阅读
- php - 亚马逊 MWS - 访问 Orders.ListOrders 被拒绝
- python - 为什么我的顺序层与 CNN 中的层不兼容?
- python - Seaborn 热图使注释文本适合单元格
- python - 如何从特定目录停用或停止脚本执行
- if-statement - 如何比较多个用户输入(单词)
- r - 使用行和向数据框(R)添加新列
- typescript - NestJS Mongo Alias Field Mongo Like Spring Data
- terraform - 使用我的 Vault 服务器验证我的 TF 代码
- excel - 为数据透视表中的数字范围创建自定义组
- xml - 用于识别 XML 文件列表中的重复项的 Powershell 脚本