Skip to content

Commit be07ce6

Browse files
committed
chore: disable rollup hoistTransitiveImports
Some imports may be optional and should be tree shaken anyway
1 parent 4629632 commit be07ce6

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

packages/foxact/rollup.config.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,24 @@ export default async function () {
3333

3434
const input = await getEntries();
3535

36-
return defineConfig([{
36+
return defineConfig([defineConfig({
3737
input,
3838
output: [
3939
{
4040
dir: 'dist',
4141
format: 'commonjs',
4242
entryFileNames: '[name]/index.cjs',
4343
chunkFileNames: 'chunks/[name].[hash].cjs',
44-
compact: true
44+
compact: true,
45+
hoistTransitiveImports: false
4546
},
4647
{
4748
dir: 'dist',
4849
format: 'esm',
4950
entryFileNames: '[name]/index.mjs',
5051
chunkFileNames: 'chunks/[name].[hash].mjs',
51-
compact: true
52+
compact: true,
53+
hoistTransitiveImports: false
5254
}
5355
],
5456
plugins: [
@@ -82,7 +84,7 @@ export default async function () {
8284
],
8385
external,
8486
cache: true
85-
}, {
87+
}), defineConfig({
8688
input,
8789
external,
8890
output: {
@@ -91,5 +93,5 @@ export default async function () {
9193
entryFileNames: '[name]/index.d.ts'
9294
},
9395
plugins: [dts({ respectExternal: true })]
94-
}]);
96+
})]);
9597
}

packages/foxact/src/breadcrumbs/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ export function createBreadcrumbs<T = unknown>(name = '(Anonymous)'): [
6161
);
6262
}
6363

64+
if (process.env.NODE_ENV !== 'production') {
65+
BreadcrumbSegment.displayName = name + '.BreadcrumbSegment';
66+
}
67+
6468
function BreadcrumbCurrent(props: BreadcrumbPageProps<T>) {
6569
const { title, meta } = props;
6670
const parentChain = useContext(ChainContext);
@@ -81,6 +85,10 @@ export function createBreadcrumbs<T = unknown>(name = '(Anonymous)'): [
8185
);
8286
}
8387

88+
if (process.env.NODE_ENV !== 'production') {
89+
BreadcrumbCurrent.displayName = name + '.BreadcrumbCurrent';
90+
}
91+
8492
function useBreadcrumbs(): BreadcrumbChain<T> {
8593
return useContext(ChainContext);
8694
}

0 commit comments

Comments
 (0)