fix(core): react monorepo account for bundler (#14617)

This commit is contained in:
Katerina Skroumpelou 2023-01-25 18:59:40 +02:00 committed by GitHub
parent 3eb669b8b6
commit d637a5ece8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

View File

@ -133,7 +133,7 @@ describe('create-nx-workspace', () => {
}
});
it('should be able to create an react workspace', () => {
it('should be able to create a react workspace with webpack', () => {
const wsName = uniq('react');
const appName = uniq('app');
@ -151,6 +151,24 @@ describe('create-nx-workspace', () => {
expect(packageJson.devDependencies['@nrwl/webpack']).toBeDefined();
});
it('should be able to create a react workspace with vite', () => {
const wsName = uniq('react');
const appName = uniq('app');
runCreateWorkspace(wsName, {
preset: 'react-monorepo',
style: 'css',
appName,
packageManager,
bundler: 'vite',
});
expectNoAngularDevkit();
const packageJson = readJson('package.json');
expect(packageJson.devDependencies['@nrwl/webpack']).not.toBeDefined();
expect(packageJson.devDependencies['@nrwl/vite']).toBeDefined();
});
it('should be able to create an next workspace', () => {
const wsName = uniq('next');
const appName = uniq('app');

View File

@ -53,7 +53,7 @@ async function createPreset(tree: Tree, options: Schema) {
name: options.name,
style: options.style,
linter: options.linter,
bundler: 'webpack',
bundler: options.bundler ?? 'webpack',
});
} else if (options.preset === Preset.ReactStandalone) {
const {