react-scrollsyx
Version:
An ambitious light-weight react module written in TypeScript for tracking scroll progress in a performant way. Developed for use with spring based animation libraries such as react-spring, but can be used with or without any library.
33 lines (31 loc) • 782 B
text/typescript
import path from 'path'
import { defineConfig } from 'vite'
// import react from '@vitejs/plugin-react'
import dts from "vite-plugin-dts";
// import peerDepsExternal from 'rollup-plugin-peer-deps-external';
export default defineConfig({
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.tsx'),
name: 'react-scrollsyx',
formats: ['es', 'umd'],
fileName: (format) => `index.${format}.js`
},
rollupOptions: {
external: ['react', 'react-dom', 'react/jsx-runtime'],
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM',
}
}
}
},
plugins: [
// peerDepsExternal(),
// react(),
dts({
insertTypesEntry: true,
})
],
})