Skip to content

Commit

Permalink
Fix external libs in preact build
Browse files Browse the repository at this point in the history
Closes #221
  • Loading branch information
simonwep committed Apr 24, 2024
1 parent 9ee3089 commit 9b3cf85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
3 changes: 1 addition & 2 deletions packages/preact/src/SelectionArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import VanillaSelectionArea from '@viselect/vanilla';
import {SelectionEvents, SelectionOptions} from '@viselect/vanilla';
import {createContext, createRef, FunctionalComponent, JSX} from 'preact';
import {useContext} from 'preact/compat';
import {useEffect, useState} from 'preact/hooks';
import {useEffect, useContext, useState} from 'preact/hooks';

export interface SelectionAreaProps extends Omit<Partial<SelectionOptions>, 'boundaries'>, JSX.HTMLAttributes<HTMLDivElement> {
id?: string;
Expand Down
10 changes: 2 additions & 8 deletions packages/preact/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ export default defineConfig(env => ({

plugins: [preact(), banner(header), dts()],

resolve: {
alias: {
'react': 'preact/compat'
}
},

build: {
sourcemap: true,
minify: 'esbuild',
Expand All @@ -26,11 +20,11 @@ export default defineConfig(env => ({
fileName: 'viselect',
},
rollupOptions: {
external: ['preact', '@viselect/react'],
external: ['preact', 'preact/hooks', '@viselect/vanilla'],
output: {
globals: {
preact: 'Preact',
'@viselect/react': 'SelectionArea'
'@viselect/vanilla': 'SelectionArea'
},
},
},
Expand Down

0 comments on commit 9b3cf85

Please sign in to comment.