I have a project reference. The reference seems to work correctly. The output seems to correctly include the referenced project. However, strangely, no errors are displayed in the command line interface for the main project itself, as opposed to the referenced project. If I temporarily remove the projectReferences option in webpack.config.js, the errors are displayed. I'm not sure why this is.
I have included the relevant configuration files below.
Any help would be much appreciated. 👍
package.json
{
"ts-loader": "6.0.0",
"typescript": "3.4.5",
"webpack": "4.31.0",
"webpack-cli": "3.3.2"
}
tsconfig.json
{
"compilerOptions":
{
"target": "es2017",
"module": "ES6",
"moduleResolution": "node",
"baseUrl": "./",
"outDir": "./build/",
"lib":
[
"es2017"
],
"removeComments": true,
"downlevelIteration": true,
"alwaysStrict": true,
"allowJs": true,
"allowSyntheticDefaultImports": true,
"paths":
{
"common/*": ["../Common/*"]
},
"watch": true
},
"references":
[
{ "path": "../Common" }
],
"include":
[
"src/**/*"
]
}
webpack.config.js
'use strict';
// External Modules
const Path = require('path');
const NodeExternals = require('webpack-node-externals');
// Constants
const IGNORE = /(?:node_modules)$/;
module.exports =
{
mode: 'development',
entry: './src/index.ts',
target: 'node',
resolve:
{
extensions:
[
'.js',
'.ts'
],
alias:
{
src: __dirname + '/src',
common: Path.join(__dirname, '../Common')
}
},
output:
{
filename: 'index.js',
path: Path.resolve(__dirname, './')
},
watch: true,
module:
{
rules:
[
{
loader: 'ts-loader',
test: /\.tsx?$/,
exclude: IGNORE,
options:
{
projectReferences: true
}
}
]
},
externals:
[
NodeExternals()
]
};
I have a project reference. The reference seems to work correctly. The output seems to correctly include the referenced project. However, strangely, no errors are displayed in the command line interface for the main project itself, as opposed to the referenced project. If I temporarily remove the
projectReferencesoption inwebpack.config.js, the errors are displayed. I'm not sure why this is.I have included the relevant configuration files below.
Any help would be much appreciated. 👍
package.json{ "ts-loader": "6.0.0", "typescript": "3.4.5", "webpack": "4.31.0", "webpack-cli": "3.3.2" }tsconfig.json{ "compilerOptions": { "target": "es2017", "module": "ES6", "moduleResolution": "node", "baseUrl": "./", "outDir": "./build/", "lib": [ "es2017" ], "removeComments": true, "downlevelIteration": true, "alwaysStrict": true, "allowJs": true, "allowSyntheticDefaultImports": true, "paths": { "common/*": ["../Common/*"] }, "watch": true }, "references": [ { "path": "../Common" } ], "include": [ "src/**/*" ] }webpack.config.js