Skip to content

Commit

Permalink
fix(webpack): update warning messages when converting to inferred
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Jun 24, 2024
1 parent c099bd4 commit 117eb70
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {
addDependenciesToPackageJson,
createProjectGraphAsync,
formatFiles,
runTasksInSerial,
type ProjectConfiguration,
runTasksInSerial,
type Tree,
} from '@nx/devkit';
import { AggregatedLog } from '@nx/devkit/src/generators/plugin-migrations/aggregate-log-util';
Expand All @@ -14,8 +14,8 @@ import { createNodesV2, type WebpackPluginOptions } from '../../plugins/plugin';
import { webpackCliVersion } from '../../utils/versions';
import {
buildPostTargetTransformerFactory,
servePostTargetTransformerFactory,
type MigrationContext,
servePostTargetTransformerFactory,
} from './utils';

interface Schema {
Expand Down Expand Up @@ -142,7 +142,7 @@ function skipProjectFilterFactory(tree: Tree) {
// the projects for which this is called are guaranteed to have a build target
const webpackConfigPath = buildTarget.options.webpackConfig;
if (!webpackConfigPath) {
return 'The webpack config path is missing in the project configuration.';
return `The webpack config path is missing in the project configuration (${projectConfiguration.root}).`;
}

const sourceFile = tsquery.ast(tree.read(webpackConfigPath, 'utf-8'));
Expand All @@ -155,7 +155,7 @@ function skipProjectFilterFactory(tree: Tree) {
)[0];

if (composePlugins) {
return 'The webpack config is still configured to solely work with the "@nx/webpack:webpack" executor. You must run the "@nx/webpack:convert-config-to-webpack" generator first.';
return `The webpack config (${webpackConfigPath}) can only work with the "@nx/webpack:webpack" executor. Run the "@nx/webpack:convert-config-to-webpack-plugin" generator first.`;
}

const nxAppWebpackPluginSelector =
Expand All @@ -166,7 +166,7 @@ function skipProjectFilterFactory(tree: Tree) {
)[0];

if (!nxAppWebpackPlugin) {
return 'No "NxAppWebpackPlugin" found in the webpack config. Its usage is required for the migration to work.';
return `No "NxAppWebpackPlugin" found in the webpack config (${webpackConfigPath}). Its usage is required for the migration to work.`;
}

return false;
Expand Down

0 comments on commit 117eb70

Please sign in to comment.