Skip to content

Commit

Permalink
fix(react): update migrations to work for projects without targets (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo authored Apr 20, 2022
1 parent 5fe8d84 commit ff3b3a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
export async function update(tree: Tree) {
const projects = getProjects(tree);
projects.forEach((config) => {
if (config.targets.test?.executor !== '@nrwl/jest:jest') return;
if (config.targets?.test?.executor !== '@nrwl/jest:jest') return;

visitNotIgnoredFiles(tree, config.sourceRoot, (file) => {
if (!file.endsWith('.spec.ts')) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function update(tree: Tree) {

projects.forEach((config, name) => {
const isReactProject =
config.targets.build?.executor === '@nrwl/web:webpack' &&
config.targets?.build?.executor === '@nrwl/web:webpack' &&
/main\.(t|j)sx?$/.test(config.targets.build.options.main);

if (isReactProject) {
Expand Down

0 comments on commit ff3b3a7

Please sign in to comment.