2022-11-24 10:49:58 +01:00
|
|
|
import { sveltekit } from '@sveltejs/kit/vite'
|
|
|
|
import type { UserConfig } from 'vite'
|
2023-01-24 07:51:42 +01:00
|
|
|
import inject from '@rollup/plugin-inject'
|
|
|
|
import stdLibBrowser from 'node-stdlib-browser'
|
2022-11-23 17:51:51 +01:00
|
|
|
|
|
|
|
const config: UserConfig = {
|
2023-01-24 07:51:42 +01:00
|
|
|
plugins: [
|
|
|
|
sveltekit(),
|
|
|
|
{
|
|
|
|
...inject({
|
|
|
|
global: ['node-stdlib-browser/helpers/esbuild/shim', 'global'],
|
|
|
|
process: ['node-stdlib-browser/helpers/esbuild/shim', 'process'],
|
|
|
|
Buffer: ['node-stdlib-browser/helpers/esbuild/shim', 'Buffer'],
|
|
|
|
}),
|
|
|
|
enforce: 'post',
|
2022-12-21 15:50:22 +01:00
|
|
|
},
|
2023-01-24 07:51:42 +01:00
|
|
|
],
|
2023-02-16 23:13:40 +01:00
|
|
|
test: {
|
|
|
|
include: ['tests/unit/**/*.{test,spec}.{js,ts}'],
|
|
|
|
},
|
2023-01-24 07:51:42 +01:00
|
|
|
resolve: {
|
|
|
|
alias: stdLibBrowser,
|
2022-12-21 15:50:22 +01:00
|
|
|
},
|
2023-01-24 07:51:42 +01:00
|
|
|
optimizeDeps: {
|
|
|
|
include: ['buffer', 'process'],
|
2022-12-21 15:50:22 +01:00
|
|
|
},
|
2022-11-24 10:49:58 +01:00
|
|
|
}
|
2022-11-23 17:51:51 +01:00
|
|
|
|
2022-11-24 10:49:58 +01:00
|
|
|
export default config
|