Skip to content

Commit

Permalink
fix(vite): correct worker plugin (#14147)
Browse files Browse the repository at this point in the history
  • Loading branch information
mandarini committed Jan 4, 2023
1 parent 67bac32 commit 29f1648
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ import { join } from 'path';
// Uncomment this if you are using workers.
// worker: {
// viteTsConfigPaths({
// root: '../',
// }),
// plugins: [
// viteTsConfigPaths({
// root: '../',
// }),
// ],
// },
// Configuration for building your library.
Expand Down Expand Up @@ -79,9 +81,11 @@ import { join } from 'path';
// Uncomment this if you are using workers.
// worker: {
// viteTsConfigPaths({
// root: '../../',
// }),
// plugins: [
// viteTsConfigPaths({
// root: '../../',
// }),
// ],
// },
// Configuration for building your library.
Expand Down Expand Up @@ -375,9 +379,11 @@ exports[`@nrwl/vite:configuration transform React app to use Vite should create
// Uncomment this if you are using workers.
// worker: {
// viteTsConfigPaths({
// root: '../../',
// }),
// plugins: [
// viteTsConfigPaths({
// root: '../../',
// }),
// ],
// },
Expand Down Expand Up @@ -516,9 +522,11 @@ exports[`@nrwl/vite:configuration transform Web app to use Vite should create vi
// Uncomment this if you are using workers.
// worker: {
// viteTsConfigPaths({
// root: '../../',
// }),
// plugins: [
// viteTsConfigPaths({
// root: '../../',
// }),
// ],
// },
Expand Down Expand Up @@ -646,9 +654,11 @@ exports[`@nrwl/vite:configuration vitest should create a vitest configuration if
// Uncomment this if you are using workers.
// worker: {
// viteTsConfigPaths({
// root: '../../',
// }),
// plugins: [
// viteTsConfigPaths({
// root: '../../',
// }),
// ],
// },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ exports[`vitest generator insourceTests should add the insourceSource option in
// Uncomment this if you are using workers.
// worker: {
// viteTsConfigPaths({
// root: '../../',
// }),
// plugins: [
// viteTsConfigPaths({
// root: '../../',
// }),
// ],
// },
define: {
Expand Down Expand Up @@ -62,9 +64,11 @@ exports[`vitest generator vite.config should create correct vite.config.ts file
// Uncomment this if you are using workers.
// worker: {
// viteTsConfigPaths({
// root: '../../',
// }),
// plugins: [
// viteTsConfigPaths({
// root: '../../',
// }),
// ],
// },
Expand Down Expand Up @@ -101,9 +105,11 @@ exports[`vitest generator vite.config should create correct vite.config.ts file
// Uncomment this if you are using workers.
// worker: {
// viteTsConfigPaths({
// root: '../../',
// }),
// plugins: [
// viteTsConfigPaths({
// root: '../../',
// }),
// ],
// },
Expand Down
8 changes: 5 additions & 3 deletions packages/vite/src/utils/generator-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,11 @@ export function createOrEditViteConfig(
const workerOption = `
// Uncomment this if you are using workers.
// worker: {
// viteTsConfigPaths({
// root: '${offsetFromRoot(projectConfig.root)}',
// }),
// plugins: [
// viteTsConfigPaths({
// root: '${offsetFromRoot(projectConfig.root)}',
// }),
// ],
// },`;

if (tree.exists(viteConfigPath)) {
Expand Down

0 comments on commit 29f1648

Please sign in to comment.