Skip to content

Commit

Permalink
fix(react): generate lib with correct imports in vite.config.ts (#13419)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo authored Nov 25, 2022
1 parent 4a5059b commit 70fa4b9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/vite/src/utils/generator-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,11 @@ ${options.includeVitest ? '/// <reference types="vitest" />' : ''}
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import ViteTsConfigPathsPlugin from 'vite-tsconfig-paths';
${options.includeLib ? "import dts from 'vite-plugin-dts';" : ''}
${
options.includeLib
? `import dts from 'vite-plugin-dts';\nimport { join } from 'path';`
: ''
}
export default defineConfig({
plugins: [
Expand All @@ -436,7 +440,11 @@ ${options.includeVitest ? '/// <reference types="vitest" />' : ''}
${options.includeVitest ? '/// <reference types="vitest" />' : ''}
import { defineConfig } from 'vite';
import ViteTsConfigPathsPlugin from 'vite-tsconfig-paths';
${options.includeLib ? "import dts from 'vite-plugin-dts';" : ''}
${
options.includeLib
? `import dts from 'vite-plugin-dts';\nimport { join } from 'path';`
: ''
}
export default defineConfig({
plugins: [
Expand Down

0 comments on commit 70fa4b9

Please sign in to comment.