mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-31 14:00:43 +00:00
37 lines
848 B
JavaScript
37 lines
848 B
JavaScript
import { fileURLToPath } from 'node:url'
|
|
|
|
const ROOT = new URL('../../', import.meta.url)
|
|
const PACKAGES_ROOT = fileURLToPath(new URL('./packages/', ROOT))
|
|
|
|
/**
|
|
* @type {import('vite').UserConfig}
|
|
*/
|
|
const config = {
|
|
envDir: fileURLToPath(ROOT),
|
|
esbuild: {
|
|
jsx: 'automatic',
|
|
jsxImportSource: 'preact',
|
|
},
|
|
resolve: {
|
|
alias: [
|
|
{
|
|
find: /^uppy\/(.+)$/,
|
|
replacement: `${PACKAGES_ROOT}uppy/$1`,
|
|
},
|
|
{
|
|
find: /^@uppy\/([^/]+)$/,
|
|
replacement: `${PACKAGES_ROOT}@uppy/$1/src/index`,
|
|
},
|
|
{
|
|
find: /^@uppy\/([^/]+)\/lib\/(.+?)(\.js)?$/,
|
|
replacement: `${PACKAGES_ROOT}@uppy/$1/src/$2`,
|
|
},
|
|
// {
|
|
// find: /^@uppy\/([^/]+)\/(.+)$/,
|
|
// replacement: PACKAGES_ROOT + "@uppy/$1/src/$2",
|
|
// },
|
|
],
|
|
},
|
|
}
|
|
|
|
export default config
|