Skip to content

Commit

Permalink
cleanup(bundling): rename imported vite-tsconfig-paths plugin to matc… (
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo authored Nov 28, 2022
1 parent 9469dba commit 3c60da7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions e2e/vite/src/vite.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,7 @@ describe('Vite Plugin', () => {
expect(result.combinedOutput).toContain(
`Successfully ran target test for project ${lib}`
);
}),
100_000;
}, 100_000);

it('should be able to run tests with inSourceTests set to true', async () => {
runCLI(
Expand Down
8 changes: 4 additions & 4 deletions packages/vite/src/generators/vitest/vitest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ describe('vitest generator', () => {
/// <reference types=\\"vitest\\" />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import ViteTsConfigPathsPlugin from 'vite-tsconfig-paths';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig({
plugins: [
react(),
ViteTsConfigPathsPlugin({
tsconfigPaths({
root: '../../',
projects: ['tsconfig.base.json'],
}),
Expand Down Expand Up @@ -141,14 +141,14 @@ describe('vitest generator', () => {
/// <reference types=\\"vitest\\" />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import ViteTsConfigPathsPlugin from 'vite-tsconfig-paths';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig({
plugins: [
react(),
ViteTsConfigPathsPlugin({
tsconfigPaths({
root: '../../',
projects: ['tsconfig.base.json'],
}),
Expand Down
8 changes: 4 additions & 4 deletions packages/vite/src/utils/generator-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ export function writeViteConfig(tree: Tree, options: Schema) {
${options.includeVitest ? '/// <reference types="vitest" />' : ''}
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import ViteTsConfigPathsPlugin from 'vite-tsconfig-paths';
import tsconfigPaths from 'vite-tsconfig-paths';
${
options.includeLib
? `import dts from 'vite-plugin-dts';\nimport { join } from 'path';`
Expand All @@ -425,7 +425,7 @@ ${options.includeVitest ? '/// <reference types="vitest" />' : ''}
plugins: [
${options.includeLib ? dtsPlugin : ''}
react(),
ViteTsConfigPathsPlugin({
tsconfigPaths({
root: '${offsetFromRoot(projectConfig.root)}',
projects: ['tsconfig.base.json'],
}),
Expand All @@ -439,7 +439,7 @@ ${options.includeVitest ? '/// <reference types="vitest" />' : ''}
viteConfigContent = `
${options.includeVitest ? '/// <reference types="vitest" />' : ''}
import { defineConfig } from 'vite';
import ViteTsConfigPathsPlugin from 'vite-tsconfig-paths';
import tsconfigPaths from 'vite-tsconfig-paths';
${
options.includeLib
? `import dts from 'vite-plugin-dts';\nimport { join } from 'path';`
Expand All @@ -449,7 +449,7 @@ ${options.includeVitest ? '/// <reference types="vitest" />' : ''}
export default defineConfig({
plugins: [
${options.includeLib ? dtsPlugin : ''}
ViteTsConfigPathsPlugin({
tsconfigPaths({
root: '${offsetFromRoot(projectConfig.root)}',
projects: ['tsconfig.base.json'],
}),
Expand Down

0 comments on commit 3c60da7

Please sign in to comment.