我正在使用TypeScript编写一个Express应用程序,并尝试使用webpack将生产代码和供应商模块转换为单个bundle.js文件。但是,由于出现了奇怪的node-pre-gyp错误,我无法这样做:
模块未找到:错误:无法在'[...]/harema-api/node_modules/bcrypt/node_modules/node-pre-gyp/lib'中解析'aws-sdk'我正在运行node 8.11.2。这是我的
webpack.config.js
:
const path = require('path');有什么想法吗?谢谢您提前。
module.exports = { entry: './src/index.ts', target: 'node', mode: 'production', devtool: 'inline-source-map', module: { rules: [ { test: /\.tsx?$/, use: 'ts-loader' } ] }, resolve: { extensions: [ '.tsx', '.ts', '.js' ] }, output: { filename: 'bundle.js', path: path.resolve(__dirname, 'dist') } };