Skip to content

Commit

Permalink
fix(vite): remove environments generation (#14515)
Browse files Browse the repository at this point in the history
  • Loading branch information
mandarini authored Jan 20, 2023
1 parent 4c23648 commit c2be735
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
8 changes: 7 additions & 1 deletion packages/react/src/generators/application/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ export async function applicationGenerator(host: Tree, schema: Schema) {
const { viteConfigurationGenerator } = await import('@nrwl/vite');
// We recommend users use `import.meta.env.MODE` and other variables in their code to differentiate between production and development.
// See: https://vitejs.dev/guide/env-and-mode.html
host.delete(joinPathFragments(options.appProjectRoot, 'src/environments'));
if (
host.exists(joinPathFragments(options.appProjectRoot, 'src/environments'))
) {
host.delete(
joinPathFragments(options.appProjectRoot, 'src/environments')
);
}

const viteTask = await viteConfigurationGenerator(host, {
uiFramework: 'react',
Expand Down
6 changes: 1 addition & 5 deletions packages/web/src/generators/application/application.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version';
import {
NxJsonConfiguration,
readProjectConfiguration,
Tree,
} from '@nrwl/devkit';
import { readProjectConfiguration, Tree } from '@nrwl/devkit';
import { getProjects, readJson } from '@nrwl/devkit';
import { createTreeWithEmptyV1Workspace } from '@nrwl/devkit/testing';

Expand Down
8 changes: 7 additions & 1 deletion packages/web/src/generators/application/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,13 @@ export async function applicationGenerator(host: Tree, schema: Schema) {
const { viteConfigurationGenerator } = require('@nrwl/vite');
// We recommend users use `import.meta.env.MODE` and other variables in their code to differentiate between production and development.
// See: https://vitejs.dev/guide/env-and-mode.html
host.delete(joinPathFragments(options.appProjectRoot, 'src/environments'));
if (
host.exists(joinPathFragments(options.appProjectRoot, 'src/environments'))
) {
host.delete(
joinPathFragments(options.appProjectRoot, 'src/environments')
);
}

const viteTask = await viteConfigurationGenerator(host, {
uiFramework: 'none',
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit c2be735

Please sign in to comment.