I'm having some trouble getting webpack to build my files. it just spits a bunch of errors, all of the same form, saying:
ERROR in ./node_modules/typescript-rest/dist/server.js
Module not found: Error: Can't resolve 'typescript-ioc/es6' in '/Users/Jack/NODE/ts-rest-session/node_modules/typescript-rest/dist'
it seems like it's not loading node_modules correctly.
tsc and ts-node are both able to build/run the project fine. Here are my configs:
tsconfig.json
{
"compilerOptions": {
"outDir": "./dist/",
"sourceMap": true,
"noImplicitAny": true,
"module": "commonjs",
"target": "es5",
"lib": ["es2015", "dom"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
}
webpack.config.js
module.exports = {
entry: {
server: './server.ts'
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
resolve: {
modules: ["node_modules"]
extensions: ['.tsx', '.ts', '.js', '.json']
},
output: {
filename: '[name].bundle.js',
path: __dirname + 'dist'
}
};
if anyone has any ideas I'm all ears! i've tried removing node_modules
form the exclude of module.rules[0] in webpack.config.json.