从 serverless-webpack 获取此错误:
ERROR in ../db/actions/index.js
Module not found: Error: Can't resolve 'amazon-dax-client' in '/var/task/db/actions'
@ ../db/actions/index.js 2:24-52
@ ../db/db.js
@ ./crop.js
我的 webpack.config.js 文件包含:
const slsw = require('serverless-webpack')
module.exports = {
entry: slsw.lib.entries,
target: 'node',
externals: {
sharp: 'commonjs sharp',
},
// Run babel on all .js files and skip those in node_modules
module: {
rules: [{
test: /\.js$/,
loader: 'babel-loader',
include: __dirname,
exclude: /node_modules/,
}]
}
}
该amazon-dax-client
模块存在于 node_modules 中。
我已经回滚到对我有用的 webpack 和 serverless-webpack 的最新版本:
"serverless-webpack": "4.3.0",
"webpack": "3.11.0"
关于如何解决或获得额外的日志输出以追踪问题的任何想法?