mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-17 13:19:55 +03:00
fix build for windows
This commit is contained in:
@@ -26,6 +26,9 @@ const RESOLVE_ALIASES = {
|
|||||||
'react/jsx-runtime': 'preact/jsx-runtime'
|
'react/jsx-runtime': 'preact/jsx-runtime'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Common resolve extensions - prioritize TypeScript/React files for Windows compatibility
|
||||||
|
const RESOLVE_EXTENSIONS = ['.tsx', '.ts', '.jsx', '.js', '.mjs', '.json'];
|
||||||
|
|
||||||
// Bundle file interface
|
// Bundle file interface
|
||||||
interface BundleFile {
|
interface BundleFile {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -101,7 +104,12 @@ const createBasePlugins = (
|
|||||||
devToolsEnabled: boolean,
|
devToolsEnabled: boolean,
|
||||||
includeBundleReporter = true
|
includeBundleReporter = true
|
||||||
) => {
|
) => {
|
||||||
const plugins = [createPreactPlugin(devToolsEnabled), viteTsconfigPaths()];
|
const plugins = [
|
||||||
|
createPreactPlugin(devToolsEnabled),
|
||||||
|
viteTsconfigPaths({
|
||||||
|
projects: ['./tsconfig.json']
|
||||||
|
})
|
||||||
|
];
|
||||||
if (includeBundleReporter) {
|
if (includeBundleReporter) {
|
||||||
plugins.push(bundleSizeReporter());
|
plugins.push(bundleSizeReporter());
|
||||||
}
|
}
|
||||||
@@ -218,7 +226,8 @@ export default defineConfig(
|
|||||||
return {
|
return {
|
||||||
plugins: [...createBasePlugins(true, true), mockServer()],
|
plugins: [...createBasePlugins(true, true), mockServer()],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: RESOLVE_ALIASES
|
alias: RESOLVE_ALIASES,
|
||||||
|
extensions: RESOLVE_EXTENSIONS
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
open: true,
|
open: true,
|
||||||
@@ -246,7 +255,8 @@ export default defineConfig(
|
|||||||
return {
|
return {
|
||||||
plugins: createBasePlugins(false, true),
|
plugins: createBasePlugins(false, true),
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: RESOLVE_ALIASES
|
alias: RESOLVE_ALIASES,
|
||||||
|
extensions: RESOLVE_EXTENSIONS
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
...createBaseBuildConfig(),
|
...createBaseBuildConfig(),
|
||||||
@@ -279,7 +289,8 @@ export default defineConfig(
|
|||||||
})
|
})
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: RESOLVE_ALIASES
|
alias: RESOLVE_ALIASES,
|
||||||
|
extensions: RESOLVE_EXTENSIONS
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
...createBaseBuildConfig(),
|
...createBaseBuildConfig(),
|
||||||
|
|||||||
Reference in New Issue
Block a user