new
This commit is contained in:
@@ -1,30 +1,82 @@
|
||||
import path from "path";
|
||||
import { defineConfig } from "vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import tailwind from "tailwindcss";
|
||||
import autoprefixer from "autoprefixer";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import { defineConfig } from "vite";
|
||||
import path from "path";
|
||||
import Package from "../package.json";
|
||||
|
||||
export default defineConfig({
|
||||
server: {
|
||||
port: 6173
|
||||
root: __dirname,
|
||||
mode: process.env.NODE_ENV,
|
||||
base: "./",
|
||||
define: {
|
||||
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "true"
|
||||
},
|
||||
plugins: [
|
||||
vue()
|
||||
vue(
|
||||
{
|
||||
template: {
|
||||
compilerOptions: {
|
||||
isCustomElement: (tag: any) => ["webview"].includes(tag),
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
],
|
||||
build: {
|
||||
sourcemap: false
|
||||
},
|
||||
optimizeDeps: {
|
||||
exclude: ["punycode"]
|
||||
server: {
|
||||
host: Package.env.VITE_DEV_SERVER_HOST,
|
||||
port: Package.env.VITE_DEV_SERVER_PORT,
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: "",
|
||||
secure: false,
|
||||
changeOrigin: true,
|
||||
rewrite: (path: any) => path.replace(/^\/api/, '')
|
||||
},
|
||||
}
|
||||
},
|
||||
css: {
|
||||
postcss: {
|
||||
plugins: [tailwind(), autoprefixer()],
|
||||
}
|
||||
},
|
||||
build: {
|
||||
outDir: "../release/dist/template",
|
||||
emptyOutDir: true,
|
||||
sourcemap: false,
|
||||
cssCodeSplit: true,
|
||||
terserOptions: {
|
||||
compress: {
|
||||
drop_console: true,
|
||||
drop_debugger: true,
|
||||
},
|
||||
},
|
||||
rollupOptions: {
|
||||
treeshake: true,
|
||||
output: {
|
||||
manualChunks(id) {
|
||||
if (id.includes("node_modules")) {
|
||||
const dependenciesKeys = Object.keys(Package.dependencies);
|
||||
const match = dependenciesKeys.find((item) => {
|
||||
return id.includes(item);
|
||||
});
|
||||
const notSplit = ["vue"];
|
||||
if (match && !notSplit.includes(match)) {
|
||||
return match;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
commonjsOptions: {
|
||||
requireReturnsDefault: "namespace",
|
||||
}
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
},
|
||||
},
|
||||
})
|
||||
"@/lib": path.resolve(__dirname, "./src/packages/shadcn"),
|
||||
"@/lib/registry/new-york/ui": path.resolve(__dirname, "./src/packages/shadcn"),
|
||||
"@/lib/registry/default/ui": path.resolve(__dirname, "./src/packages/shadcn")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user