Skip to content

Commit

Permalink
build: setup build using @tanstacl/config
Browse files Browse the repository at this point in the history
  • Loading branch information
Mor Kadosh committed Apr 29, 2024
1 parent 0fc6265 commit 3ad1800
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
2 changes: 1 addition & 1 deletion packages/lit-virtual/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"url": "https://github.com/sponsors/tannerlinsley"
},
"type": "module",
"types": "dist/index.d.ts",
"types": "dist/esm/index.d.ts",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.js",
"exports": {
Expand Down
32 changes: 9 additions & 23 deletions packages/lit-virtual/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,19 @@
import { defineConfig, mergeConfig } from 'vitest/config'
import packageJson from './package.json'
import dts from 'vite-plugin-dts'
import { resolve } from 'node:path'
import { tanstackBuildConfig } from '@tanstack/config/build'

const config = defineConfig({
plugins: [],
test: {
name: packageJson.name,
name: 'react-form',
watch: false,
environment: 'jsdom'
},
})

export default mergeConfig(config, {
plugins: [
dts({
include: ['src'],
export default mergeConfig(
config,
tanstackBuildConfig({
entry: './src/index.ts',
srcDir: './src',
}),
],
build: {
lib: {
entry: resolve('src', 'index.ts'),
formats: ['es', 'cjs'],
fileName: (format: string) => {
if (format === 'cjs') return 'cjs/[name].cjs'
return 'esm/[name].js'
},
},
rollupOptions: {
external: ['lit']
},
},
})
)

0 comments on commit 3ad1800

Please sign in to comment.