Revert "feat(vite): use the project's tsconfig.json to configure plug… (#13415)
This commit is contained in:
parent
2c13661b90
commit
c0f12757f1
File diff suppressed because one or more lines are too long
@ -170,7 +170,7 @@ export default defineConfig({
|
||||
react(),
|
||||
ViteTsConfigPathsPlugin({
|
||||
root: '../../',
|
||||
projects: ['./tsconfig.json'],
|
||||
projects: ['tsconfig.base.json'],
|
||||
}),
|
||||
],
|
||||
});
|
||||
@ -213,7 +213,7 @@ export default mergeConfig(baseConfig, {
|
||||
react(),
|
||||
ViteTsConfigPathsPlugin({
|
||||
root: '../../',
|
||||
projects: ['./tsconfig.json'],
|
||||
projects: ['tsconfig.base.json'],
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
@ -84,7 +84,6 @@ describe('Vite Plugin', () => {
|
||||
`apps/${myApp}/vite.config.ts`,
|
||||
`
|
||||
/// <reference types="vitest" />
|
||||
import { join } from 'path';
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import plugin from 'vite-tsconfig-paths';
|
||||
@ -94,7 +93,7 @@ describe('Vite Plugin', () => {
|
||||
react(),
|
||||
plugin({
|
||||
root: '../../',
|
||||
projects: [join(__dirname, 'tsconfig.json')],
|
||||
projects: ['tsconfig.base.json'],
|
||||
}),
|
||||
],
|
||||
test: {
|
||||
|
||||
@ -103,7 +103,6 @@ describe('vitest generator', () => {
|
||||
expect(viteConfig).toMatchInlineSnapshot(`
|
||||
"
|
||||
/// <reference types=\\"vitest\\" />
|
||||
import { join } from 'path';
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import ViteTsConfigPathsPlugin from 'vite-tsconfig-paths';
|
||||
@ -113,7 +112,7 @@ describe('vitest generator', () => {
|
||||
react(),
|
||||
ViteTsConfigPathsPlugin({
|
||||
root: '../../',
|
||||
projects: [join(__dirname, 'tsconfig.json')],
|
||||
projects: ['tsconfig.base.json'],
|
||||
}),
|
||||
],
|
||||
|
||||
@ -137,7 +136,6 @@ describe('vitest generator', () => {
|
||||
expect(viteConfig).toMatchInlineSnapshot(`
|
||||
"
|
||||
/// <reference types=\\"vitest\\" />
|
||||
import { join } from 'path';
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import ViteTsConfigPathsPlugin from 'vite-tsconfig-paths';
|
||||
@ -147,7 +145,7 @@ describe('vitest generator', () => {
|
||||
react(),
|
||||
ViteTsConfigPathsPlugin({
|
||||
root: '../../',
|
||||
projects: [join(__dirname, 'tsconfig.json')],
|
||||
projects: ['tsconfig.base.json'],
|
||||
}),
|
||||
],
|
||||
define: {
|
||||
|
||||
@ -375,7 +375,6 @@ export function writeViteConfig(tree: Tree, options: Schema) {
|
||||
case 'react':
|
||||
viteConfigContent = `
|
||||
${options.includeVitest ? '/// <reference types="vitest" />' : ''}
|
||||
import { join } from 'path';
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import ViteTsConfigPathsPlugin from 'vite-tsconfig-paths';
|
||||
@ -385,7 +384,7 @@ ${options.includeVitest ? '/// <reference types="vitest" />' : ''}
|
||||
react(),
|
||||
ViteTsConfigPathsPlugin({
|
||||
root: '${offsetFromRoot(projectConfig.root)}',
|
||||
projects: [join(__dirname, 'tsconfig.json')],
|
||||
projects: ['tsconfig.base.json'],
|
||||
}),
|
||||
],
|
||||
${options.inSourceTests ? defineOption : ''}
|
||||
@ -395,7 +394,6 @@ ${options.includeVitest ? '/// <reference types="vitest" />' : ''}
|
||||
case 'none':
|
||||
viteConfigContent = `
|
||||
${options.includeVitest ? '/// <reference types="vitest" />' : ''}
|
||||
import { join } from 'path';
|
||||
import { defineConfig } from 'vite';
|
||||
import ViteTsConfigPathsPlugin from 'vite-tsconfig-paths';
|
||||
|
||||
@ -403,7 +401,7 @@ ${options.includeVitest ? '/// <reference types="vitest" />' : ''}
|
||||
plugins: [
|
||||
ViteTsConfigPathsPlugin({
|
||||
root: '${offsetFromRoot(projectConfig.root)}',
|
||||
projects: [join(__dirname, 'tsconfig.json')],
|
||||
projects: ['tsconfig.base.json'],
|
||||
}),
|
||||
],
|
||||
${options.inSourceTests ? defineOption : ''}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user