forked from mbarzda/solid-i18next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.docs.config.js
39 lines (35 loc) · 1.01 KB
/
vite.docs.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { createRequire } from 'node:module';
import { resolve } from 'node:path';
import { defineConfig } from 'vite';
import solidPlugin from 'vite-plugin-solid';
const require = createRequire(import.meta.url);
const ignoreImport = () => {
const virtualModuleId = 'html-parse-string';
const resolvedVirtualModuleId = '\0' + virtualModuleId;
return {
name: 'ignore-import',
resolveId(id) {
if (id === virtualModuleId) {
return resolvedVirtualModuleId;
}
},
load(id) {
if (id !== resolvedVirtualModuleId) return;
try {
require(virtualModuleId);
} catch {
return `export const parse = undefined`;
}
},
};
};
export default defineConfig({
base: '/solid-i18next/',
build: { outDir: resolve('./dist') },
css: {
modules: { localsConvention: 'camelCaseOnly' },
},
plugins: [solidPlugin(), ignoreImport()],
resolve: { alias: { '@mbarzda/solid-i18next': resolve('./src/index.ts'), '#': resolve('./docs/src') } },
root: './docs',
});