-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: hotfix on vite configuration (#493)
- Loading branch information
1 parent
4a73ac0
commit 51eca3d
Showing
6 changed files
with
47 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,42 @@ | ||
import react from "@vitejs/plugin-react" | ||
import { defineConfig, loadEnv } from "vite" | ||
import dynamicImport from "vite-plugin-dynamic-import" | ||
const path = require("path") | ||
|
||
export default { | ||
root: "./src", | ||
rollupOptions: { | ||
input: "wasedatime-career.ts", | ||
preserveEntrySignatures: true, | ||
}, | ||
build: { | ||
outDir: "../dist", | ||
emptyOutDir: true, | ||
export default defineConfig(({ mode }) => { | ||
const env = loadEnv(mode, process.cwd() + "/src") | ||
|
||
return { | ||
root: "./src", | ||
publicDir: "assets", | ||
base: (env.VITE_PUBLIC_BASE_PATH || "http://localhost:8082") + "/", | ||
rollupOptions: { | ||
input: "./src/wasedatime-career.ts", | ||
input: "wasedatime-career.ts", | ||
preserveEntrySignatures: true, | ||
output: { | ||
entryFileNames: "wasedatime-career.js", | ||
}, | ||
build: { | ||
outDir: "../dist", | ||
emptyOutDir: true, | ||
cssCodeSplit: false, | ||
manifest: true, | ||
rollupOptions: { | ||
input: "./src/wasedatime-career.ts", | ||
preserveEntrySignatures: true, | ||
output: { | ||
entryFileNames: "[name].js", | ||
assetFileNames: "assets/[name].[ext]", | ||
}, | ||
}, | ||
}, | ||
}, | ||
resolve: { | ||
fullySpecified: false, | ||
alias: { | ||
"@app": path.resolve(__dirname, "src/"), | ||
resolve: { | ||
fullySpecified: false, | ||
alias: { | ||
"@app": path.resolve(__dirname, "src/"), | ||
}, | ||
modules: ["node_modules"], | ||
}, | ||
modules: ["node_modules"], | ||
}, | ||
plugins: [react(), dynamicImport()], | ||
envPrefix: ["VITE_", "REACT_APP_"], | ||
} | ||
plugins: [react(), dynamicImport()], | ||
assetsInclude: ["**/*.png", "**/*.jpg", "**/*.svg"], | ||
envPrefix: ["VITE_", "REACT_APP_"], | ||
} | ||
}) |