I am trying to build my serverless app using NestJS Dataloader. Attached is my webpack config file.
The issue I am facing is that my webpack is looking for NestDataLoader in the dist/index.js file which doesnt have NestDataLoader defined in it. its actually the part of index.ts in NestJS Dataloader distribution.
module.exports = {
mode: isLocal ? 'development' : 'production',
devtool: isLocal ? 'source-map' : 'none',
entry: slsw.lib.entries,
target: 'node',
resolve: {
plugins: [new TsconfigPathsPlugin({ configFile: "./tsconfig.json" })],
extensions: ['.mjs', '.ts', '.js']
},
output: {
libraryTarget: 'commonjs2',
path: path.join(__dirname, '.webpack'),
filename: '[name].js'
},
externals: [nodeExternals()],
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
loader: 'ts-loader',
options: { allowTsInNodeModules: true }
}
]
}
}
I am trying to build my serverless app using NestJS Dataloader. Attached is my webpack config file.
The issue I am facing is that my webpack is looking for NestDataLoader in the dist/index.js file which doesnt have NestDataLoader defined in it. its actually the part of index.ts in NestJS Dataloader distribution.
const path = require('path')
const slsw = require('serverless-webpack')
const isLocal = slsw.lib.webpack.isLocal
const nodeExternals = require('webpack-node-externals')
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');