wip: support vite

This commit is contained in:
vben
2021-01-09 23:28:52 +08:00
parent 1d3007f030
commit 99ac309fa9
105 changed files with 954 additions and 2170 deletions

View File

@@ -0,0 +1,12 @@
import dynamicImport from 'vite-plugin-import-context';
import type { ViteEnv } from '../../utils';
import type { Plugin } from 'vite';
export function configDynamicImport(env: ViteEnv) {
const { VITE_DYNAMIC_IMPORT } = env;
const dynamicImportPlugin: Plugin = dynamicImport({
include: ['**/*.ts'],
autoImportRoute: VITE_DYNAMIC_IMPORT,
});
return dynamicImportPlugin;
}