|
1 | | -import * as path from 'node:path' |
2 | | -import { defineConfig } from 'vitest/config' |
| 1 | +import path from 'node:path' |
| 2 | +import { defineConfig } from 'vite' |
3 | 3 | import angular from '@analogjs/vite-plugin-angular' |
4 | | -import packageJson from './package.json' |
5 | | - |
6 | | -const tsconfigPath = path.join(import.meta.dirname, 'tsconfig.test.json') |
7 | | -const testDirPath = path.join(import.meta.dirname, 'tests') |
8 | | -const angularPlugin = angular({ tsconfig: tsconfigPath, jit: true }) |
9 | 4 |
|
10 | 5 | export default defineConfig({ |
11 | | - plugins: [angularPlugin], |
12 | | - test: { |
13 | | - name: packageJson.name, |
14 | | - watch: false, |
15 | | - dir: testDirPath, |
16 | | - pool: 'threads', |
17 | | - environment: 'jsdom', |
18 | | - setupFiles: [path.join(testDirPath, 'test-setup.ts')], |
19 | | - globals: true, |
20 | | - reporters: 'default', |
21 | | - disableConsoleIntercept: true, |
| 6 | + root: import.meta.dirname, |
| 7 | + plugins: [ |
| 8 | + angular({ |
| 9 | + tsconfig: path.join(import.meta.dirname, 'tsconfig.build.json'), |
| 10 | + }), |
| 11 | + ], |
| 12 | + resolve: { |
| 13 | + mainFields: ['module'], |
| 14 | + }, |
| 15 | + build: { |
| 16 | + target: ['esnext'], |
| 17 | + sourcemap: true, |
| 18 | + lib: { |
| 19 | + entry: 'src/index.ts', |
| 20 | + fileName: `fesm2022/tanstack-angular-table`, |
| 21 | + formats: ['es'], |
| 22 | + }, |
| 23 | + rolldownOptions: { |
| 24 | + external: [/^@angular\/.*/, /^@tanstack\/.*/, 'rxjs', 'rxjs/operators'], |
| 25 | + output: { |
| 26 | + preserveModules: false, |
| 27 | + }, |
| 28 | + }, |
| 29 | + minify: false, |
22 | 30 | }, |
23 | 31 | }) |
0 commit comments