Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Errors Displayed with Project References #932

Closed
ChrisTalman opened this issue May 10, 2019 · 1 comment · Fixed by #937
Closed

No Errors Displayed with Project References #932

ChrisTalman opened this issue May 10, 2019 · 1 comment · Fixed by #937
Assignees

Comments

@ChrisTalman
Copy link

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()
	]
};
@andrewbranch andrewbranch self-assigned this May 11, 2019
@ryanstaniforth
Copy link

I'm experiencing the exact same issue. If I remove projectReferences: true I suddenly get all the errors I'm expecting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants