mirror of
https://github.com/facebook/lexical.git
synced 2025-05-17 15:18:47 +08:00
[lexical-website] Bug Fix: Fix vite.config.ts for gallery examples (#7290)
This commit is contained in:
@ -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"
|
||||
},
|
||||
|
15
examples/react-plain-text/vite.config.monorepo.ts
Normal file
15
examples/react-plain-text/vite.config.monorepo.ts
Normal file
@ -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()],
|
||||
});
|
@ -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()],
|
||||
});
|
||||
|
@ -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",
|
||||
|
15
examples/react-rich-collab/vite.config.monorepo.ts
Normal file
15
examples/react-rich-collab/vite.config.monorepo.ts
Normal file
@ -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()],
|
||||
});
|
@ -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: {
|
||||
@ -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()],
|
||||
});
|
||||
|
@ -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"
|
||||
},
|
||||
|
15
examples/react-rich/vite.config.monorepo.ts
Normal file
15
examples/react-rich/vite.config.monorepo.ts
Normal file
@ -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()],
|
||||
});
|
@ -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()],
|
||||
});
|
||||
|
@ -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"
|
||||
},
|
||||
|
15
examples/react-table/vite.config.monorepo.ts
Normal file
15
examples/react-table/vite.config.monorepo.ts
Normal file
@ -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()],
|
||||
});
|
@ -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()],
|
||||
});
|
||||
|
@ -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"
|
||||
},
|
||||
|
15
examples/vanilla-js-iframe/vite.config.monorepo.ts
Normal file
15
examples/vanilla-js-iframe/vite.config.monorepo.ts
Normal file
@ -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()],
|
||||
});
|
@ -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({});
|
||||
|
@ -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"
|
||||
},
|
||||
|
15
examples/vanilla-js-plugin/vite.config.monorepo.ts
Normal file
15
examples/vanilla-js-plugin/vite.config.monorepo.ts
Normal file
@ -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()],
|
||||
});
|
@ -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(
|
||||
@ -30,4 +18,4 @@ export default defineConfig(async () => ({
|
||||
),
|
||||
},
|
||||
},
|
||||
}));
|
||||
});
|
||||
|
@ -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"
|
||||
},
|
||||
|
15
examples/vanilla-js/vite.config.monorepo.ts
Normal file
15
examples/vanilla-js/vite.config.monorepo.ts
Normal file
@ -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()],
|
||||
});
|
@ -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({});
|
||||
|
Reference in New Issue
Block a user