Skip to content

Commit b486637

Browse files
authored
chore(build): fix AI packaging issue (#2210)
* fix xl-ai bundle issue * fix website build
1 parent 0ea6a01 commit b486637

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

docs/app/(home)/hero/DemoEditor.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
import {
22
BlockNoteSchema,
33
combineByGroup,
4-
filterSuggestionItems,
54
uploadToTmpFilesDotOrg_DEV_ONLY,
65
} from "@blocknote/core";
7-
import * as locales from "@blocknote/core/locales";
6+
import { filterSuggestionItems } from "@blocknote/core/extensions";
87
import "@blocknote/core/fonts/inter.css";
8+
import * as locales from "@blocknote/core/locales";
9+
import { BlockNoteView } from "@blocknote/mantine";
10+
import "@blocknote/mantine/style.css";
911
import {
1012
getDefaultReactSlashMenuItems,
1113
SuggestionMenuController,
1214
useCreateBlockNote,
1315
} from "@blocknote/react";
14-
import { BlockNoteView } from "@blocknote/mantine";
1516
import {
1617
getMultiColumnSlashMenuItems,
17-
locales as multiColumnLocales,
1818
multiColumnDropCursor,
19+
locales as multiColumnLocales,
1920
withMultiColumn,
2021
} from "@blocknote/xl-multi-column";
21-
import "@blocknote/mantine/style.css";
2222
import { useTheme } from "next-themes";
2323
import { useCallback, useMemo, useState } from "react";
2424
import YPartyKitProvider from "y-partykit/provider";

packages/xl-ai/vite.config.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,27 @@ export default defineConfig((conf) => ({
4444
rollupOptions: {
4545
// make sure to externalize deps that shouldn't be bundled
4646
// into your library
47-
external: [
48-
...Object.keys({
49-
...pkg.dependencies,
50-
...pkg.peerDependencies,
51-
...pkg.devDependencies,
52-
}),
53-
"react-dom/client",
54-
"react/jsx-runtime",
55-
],
47+
external: (source) => {
48+
if (
49+
[
50+
...Object.keys({
51+
...pkg.dependencies,
52+
...pkg.peerDependencies,
53+
...pkg.devDependencies,
54+
}),
55+
"react-dom/client",
56+
"react/jsx-runtime",
57+
].includes(source)
58+
) {
59+
return true;
60+
}
61+
62+
return (
63+
source.startsWith("prosemirror-") ||
64+
source.startsWith("@tiptap/") ||
65+
source.startsWith("@blocknote/")
66+
);
67+
},
5668
output: {
5769
// Provide global variables to use in the UMD build
5870
// for externalized deps

0 commit comments

Comments
 (0)