Skip to content

Commit

Permalink
fix(vite): add prop to config to ensure output dir is emptied #23382
Browse files Browse the repository at this point in the history
  • Loading branch information
Coly010 committed May 17, 2024
1 parent 0f47f03 commit 41b49f6
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ nxViteTsPaths()],
build: {
outDir: '../dist/my-vite-app',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ nxViteTsPaths()],
build: {
outDir: '../dist/my-app',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
Expand Down Expand Up @@ -197,6 +198,7 @@ nxViteTsPaths()],
build: {
outDir: '../dist/my-app',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
Expand Down Expand Up @@ -322,6 +324,7 @@ nxViteTsPaths()],
build: {
outDir: '../dist/my-app',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ dts({ entryRoot: 'src', tsconfigPath: path.join(__dirname, 'tsconfig.lib.json')
// See: https://vitejs.dev/guide/build.html#library-mode
build: {
outDir: '../dist/my-lib',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default defineConfig({
// See: https://vitejs.dev/guide/build.html#library-mode
build: {
outDir: '../../dist/libs/react-lib-nonb-jest',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
Expand Down Expand Up @@ -82,6 +83,7 @@ export default defineConfig({
// See: https://vitejs.dev/guide/build.html#library-mode
build: {
outDir: '../../dist/libs/react-lib-nonb-jest',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
Expand Down Expand Up @@ -132,6 +134,7 @@ export default defineConfig({
cacheDir: '../../node_modules/.vite/libs/react-lib-nonb-vitest',
build: {
outDir: '../../dist/libs/react-lib-nonb-vitest',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
Expand Down Expand Up @@ -203,6 +206,7 @@ export default defineConfig({
build: {
outDir: '../../dist/apps/my-test-react-app',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
Expand Down Expand Up @@ -260,6 +264,7 @@ export default defineConfig({
build: {
outDir: '../../dist/apps/my-test-web-app',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
Expand Down Expand Up @@ -317,6 +322,7 @@ export default defineConfig({
build: {
outDir: '../../dist/apps/my-test-react-app',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
Expand Down
2 changes: 2 additions & 0 deletions packages/vite/src/utils/generator-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ export function createOrEditViteConfig(
// See: https://vitejs.dev/guide/build.html#library-mode
build: {
outDir: '${buildOutDir}',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
Expand All @@ -395,6 +396,7 @@ export function createOrEditViteConfig(
: `
build: {
outDir: '${buildOutDir}',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export default defineConfig({
build: {
outDir: '../dist/test',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default defineConfig({
// See: https://vitejs.dev/guide/build.html#library-mode
build: {
outDir: '../dist/my-lib',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
Expand Down Expand Up @@ -125,6 +126,7 @@ export default defineConfig({
// See: https://vitejs.dev/guide/build.html#library-mode
build: {
outDir: '../dist/my-lib',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
Expand Down

0 comments on commit 41b49f6

Please sign in to comment.