first commit
This commit is contained in:
49
json-to-class/vite.config.ts
Normal file
49
json-to-class/vite.config.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { defineConfig, type PluginOption } from "vite";
|
||||
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
||||
import { internalIpV4 } from "internal-ip";
|
||||
import { less } from 'svelte-preprocess-less';
|
||||
import { visualizer } from "rollup-plugin-visualizer";
|
||||
import { join } from "path";
|
||||
import monacoEditorPlugin, { IMonacoEditorOpts } from 'vite-plugin-monaco-editor';
|
||||
|
||||
const mobile = !!/android|ios/.exec(process.env.TAURI_ENV_PLATFORM);
|
||||
const monacoEditorPluginDefault = ((monacoEditorPlugin as any).default) as (options: IMonacoEditorOpts) => any;
|
||||
|
||||
export default defineConfig(async () => ({
|
||||
base: "./",
|
||||
build: {
|
||||
target: 'esnext'
|
||||
},
|
||||
plugins: [
|
||||
visualizer({
|
||||
template: 'treemap'
|
||||
}) as PluginOption,
|
||||
svelte({
|
||||
preprocess: {
|
||||
style: less(),
|
||||
},
|
||||
}),
|
||||
monacoEditorPluginDefault({
|
||||
languageWorkers: [ 'json' ]
|
||||
})
|
||||
],
|
||||
|
||||
clearScreen: false,
|
||||
server : {
|
||||
port : 1420,
|
||||
strictPort: true,
|
||||
host : mobile ? "0.0.0.0" : false,
|
||||
hmr : mobile
|
||||
? {
|
||||
protocol: "ws",
|
||||
host : await internalIpV4(),
|
||||
port : 1421,
|
||||
}
|
||||
: undefined,
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': join(__dirname, "src/"),
|
||||
}
|
||||
}
|
||||
}));
|
||||
Reference in New Issue
Block a user