Skip to content

Commit

Permalink
Fix vite.config.ts for gallery examples
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed Mar 4, 2025
1 parent 7931e11 commit db0cb4a
Show file tree
Hide file tree
Showing 21 changed files with 129 additions and 110 deletions.
2 changes: 1 addition & 1 deletion examples/react-plain-text/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"monorepo:dev": "cross-env LEXICAL_MONOREPO=1 npm run dev --",
"monorepo:dev": "vite -c vite.config.monorepo.ts",
"build": "tsc && vite build",
"preview": "vite preview"
},
Expand Down
15 changes: 15 additions & 0 deletions examples/react-plain-text/vite.config.monorepo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import {mergeConfig} from 'vite';

import lexicalMonorepoPlugin from '../../packages/shared/lexicalMonorepoPlugin';
import config from './vite.config';

export default mergeConfig(config, {
plugins: [lexicalMonorepoPlugin()],
});
18 changes: 3 additions & 15 deletions examples/react-plain-text/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@ import react from '@vitejs/plugin-react';
import {defineConfig} from 'vite';

// https://vitejs.dev/config/
export default defineConfig(async () => ({
plugins: [
react(),
// This is only used for development in the lexical repository
...(process.env.LEXICAL_MONOREPO === '1'
? [
(
await import(
'../../packages/shared/lexicalMonorepoPlugin' as string
)
).default(),
]
: []),
],
}));
export default defineConfig({
plugins: [react()],
});
4 changes: 2 additions & 2 deletions examples/react-rich-collab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"scripts": {
"dev": "vite",
"dev:local": "cross-env NODE_ENV=development concurrently \"npm:server:ws\" \"npm:server:webrtc\" \"vite\"",
"monorepo:dev": "cross-env LEXICAL_MONOREPO=1 run dev --",
"monorepo:dev:local": "cross-env LEXICAL_MONOREPO=1 npm run dev:local --",
"monorepo:dev": "vite -c vite.config.monorepo.ts",
"monorepo:dev:local": "cross-env NODE_ENV=development concurrently \"npm:server:ws\" \"npm:server:webrtc\" \"vite -c vite.config.monorepo.ts\"",
"build": "tsc && vite build",
"preview": "vite preview",
"server:ws": "cross-env HOST=localhost PORT=1234 YPERSISTENCE=./yjs-wss-db npx y-websocket",
Expand Down
15 changes: 15 additions & 0 deletions examples/react-rich-collab/vite.config.monorepo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import {mergeConfig} from 'vite';

import lexicalMonorepoPlugin from '../../packages/shared/lexicalMonorepoPlugin';
import config from './vite.config';

export default mergeConfig(config, {
plugins: [lexicalMonorepoPlugin()],
});
18 changes: 3 additions & 15 deletions examples/react-rich-collab/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {resolve} from 'path';
import {defineConfig} from 'vite';

// https://vitejs.dev/config/
export default defineConfig(async () => ({
export default defineConfig({
build: {
rollupOptions: {
input: {
Expand All @@ -19,17 +19,5 @@ export default defineConfig(async () => ({
},
},
},
plugins: [
react(),
// This is only used for development in the lexical repository
...(process.env.LEXICAL_MONOREPO === '1'
? [
(
await import(
'../../packages/shared/lexicalMonorepoPlugin' as string
)
).default(),
]
: []),
],
}));
plugins: [react()],
});
2 changes: 1 addition & 1 deletion examples/react-rich/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"monorepo:dev": "cross-env LEXICAL_MONOREPO=1 npm run dev --",
"monorepo:dev": "vite -c vite.config.monorepo.ts",
"build": "tsc && vite build",
"preview": "vite preview"
},
Expand Down
15 changes: 15 additions & 0 deletions examples/react-rich/vite.config.monorepo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import {mergeConfig} from 'vite';

import lexicalMonorepoPlugin from '../../packages/shared/lexicalMonorepoPlugin';
import config from './vite.config';

export default mergeConfig(config, {
plugins: [lexicalMonorepoPlugin()],
});
18 changes: 3 additions & 15 deletions examples/react-rich/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@ import react from '@vitejs/plugin-react';
import {defineConfig} from 'vite';

// https://vitejs.dev/config/
export default defineConfig(async () => ({
plugins: [
react(),
// This is only used for development in the lexical repository
...(process.env.LEXICAL_MONOREPO === '1'
? [
(
await import(
'../../packages/shared/lexicalMonorepoPlugin' as string
)
).default(),
]
: []),
],
}));
export default defineConfig({
plugins: [react()],
});
2 changes: 1 addition & 1 deletion examples/react-table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"monorepo:dev": "cross-env LEXICAL_MONOREPO=1 npm run dev --",
"monorepo:dev": "vite -c vite.config.monorepo.ts",
"build": "tsc && vite build",
"preview": "vite preview"
},
Expand Down
15 changes: 15 additions & 0 deletions examples/react-table/vite.config.monorepo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import {mergeConfig} from 'vite';

import lexicalMonorepoPlugin from '../../packages/shared/lexicalMonorepoPlugin';
import config from './vite.config';

export default mergeConfig(config, {
plugins: [lexicalMonorepoPlugin()],
});
18 changes: 3 additions & 15 deletions examples/react-table/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@ import react from '@vitejs/plugin-react';
import {defineConfig} from 'vite';

// https://vitejs.dev/config/
export default defineConfig(async () => ({
plugins: [
react(),
// This is only used for development in the lexical repository
...(process.env.LEXICAL_MONOREPO === '1'
? [
(
await import(
'../../packages/shared/lexicalMonorepoPlugin' as string
)
).default(),
]
: []),
],
}));
export default defineConfig({
plugins: [react()],
});
2 changes: 1 addition & 1 deletion examples/vanilla-js-iframe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"monorepo:dev": "cross-env LEXICAL_MONOREPO=1 npm run dev --",
"monorepo:dev": "vite -c vite.config.monorepo.ts",
"build": "tsc && vite build",
"preview": "vite preview"
},
Expand Down
15 changes: 15 additions & 0 deletions examples/vanilla-js-iframe/vite.config.monorepo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import {mergeConfig} from 'vite';

import lexicalMonorepoPlugin from '../../packages/shared/lexicalMonorepoPlugin';
import config from './vite.config';

export default mergeConfig(config, {
plugins: [lexicalMonorepoPlugin()],
});
15 changes: 1 addition & 14 deletions examples/vanilla-js-iframe/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,4 @@
import {defineConfig} from 'vite';

// https://vitejs.dev/config/
export default defineConfig(async () => ({
plugins: [
// This is only used for development in the lexical repository
...(process.env.LEXICAL_MONOREPO === '1'
? [
(
await import(
'../../packages/shared/lexicalMonorepoPlugin' as string
)
).default(),
]
: []),
],
}));
export default defineConfig({});
2 changes: 1 addition & 1 deletion examples/vanilla-js-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"monorepo:dev": "cross-env LEXICAL_MONOREPO=1 npm run dev --",
"monorepo:dev": "vite -c vite.config.monorepo.ts",
"build": "tsc && vite build",
"preview": "vite preview"
},
Expand Down
15 changes: 15 additions & 0 deletions examples/vanilla-js-plugin/vite.config.monorepo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import {mergeConfig} from 'vite';

import lexicalMonorepoPlugin from '../../packages/shared/lexicalMonorepoPlugin';
import config from './vite.config';

export default mergeConfig(config, {
plugins: [lexicalMonorepoPlugin()],
});
16 changes: 2 additions & 14 deletions examples/vanilla-js-plugin/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,7 @@ import path from 'path';
import {defineConfig} from 'vite';

// https://vitejs.dev/config/
export default defineConfig(async () => ({
plugins: [
// This is only used for development in the lexical repository
...(process.env.LEXICAL_MONOREPO === '1'
? [
(
await import(
'../../packages/shared/lexicalMonorepoPlugin' as string
)
).default(),
]
: []),
],
export default defineConfig({
resolve: {
alias: {
'@emoji-datasource-facebook': path.resolve(
Expand All @@ -30,4 +18,4 @@ export default defineConfig(async () => ({
),
},
},
}));
});
2 changes: 1 addition & 1 deletion examples/vanilla-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"monorepo:dev": "cross-env LEXICAL_MONOREPO=1 npm run dev --",
"monorepo:dev": "vite -c vite.config.monorepo.ts",
"build": "tsc && vite build",
"preview": "vite preview"
},
Expand Down
15 changes: 15 additions & 0 deletions examples/vanilla-js/vite.config.monorepo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import {mergeConfig} from 'vite';

import lexicalMonorepoPlugin from '../../packages/shared/lexicalMonorepoPlugin';
import config from './vite.config';

export default mergeConfig(config, {
plugins: [lexicalMonorepoPlugin()],
});
15 changes: 1 addition & 14 deletions examples/vanilla-js/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,4 @@
import {defineConfig} from 'vite';

// https://vitejs.dev/config/
export default defineConfig(async () => ({
plugins: [
// This is only used for development in the lexical repository
...(process.env.LEXICAL_MONOREPO === '1'
? [
(
await import(
'../../packages/shared/lexicalMonorepoPlugin' as string
)
).default(),
]
: []),
],
}));
export default defineConfig({});

0 comments on commit db0cb4a

Please sign in to comment.