mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 11:23:24 +00:00
update deps, migrate to pnpm
This commit is contained in:
42
vite.config.ts
Normal file
42
vite.config.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import path from 'path';
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import eslintPlugin from '@nabla/vite-plugin-eslint';
|
||||
import dts from 'vite-plugin-dts';
|
||||
import pkg from './package.json';
|
||||
|
||||
const shouldTestProviders = process.env.MW_TEST_PROVIDERS === 'true';
|
||||
let tests: string[] = ['src/__test__/standard/**/*.test.ts'];
|
||||
if (shouldTestProviders) tests = ['src/__test__/providers/**/*.test.ts'];
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
eslintPlugin({}),
|
||||
dts({
|
||||
rollupTypes: true,
|
||||
}),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
},
|
||||
},
|
||||
build: {
|
||||
minify: false,
|
||||
rollupOptions: {
|
||||
external: Object.keys(pkg.dependencies),
|
||||
output: {
|
||||
globals: Object.fromEntries(Object.keys(pkg.dependencies).map((v) => [v, v])),
|
||||
},
|
||||
},
|
||||
outDir: 'lib',
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, 'src/index.ts'),
|
||||
name: 'index',
|
||||
fileName: 'index',
|
||||
formats: ['umd', 'es'],
|
||||
},
|
||||
},
|
||||
test: {
|
||||
include: tests,
|
||||
},
|
||||
});
|
Reference in New Issue
Block a user