Fix Vite config
Node plugin would also work on build which messes up the `root` config entry. This should fix the deploy not working.
This commit is contained in:
parent
3d528cc4e4
commit
c53384a54d
1 changed files with 14 additions and 14 deletions
|
@ -1,15 +1,7 @@
|
|||
import legacy from "@vitejs/plugin-legacy";
|
||||
import { VitePluginNode } from "vite-plugin-node";
|
||||
|
||||
export default {
|
||||
build: {
|
||||
minify: "terser",
|
||||
terserOptions: { ecma: 5 },
|
||||
sourcemap: "true",
|
||||
},
|
||||
plugins: [
|
||||
legacy(),
|
||||
VitePluginNode({
|
||||
const vitePluginNode = VitePluginNode({
|
||||
// Workaround from: https://github.com/axe-me/vite-plugin-node/issues/47
|
||||
adapter({ app, req, res, next }) {
|
||||
if (req.url.startsWith("/api/")) {
|
||||
|
@ -19,6 +11,14 @@ export default {
|
|||
}
|
||||
},
|
||||
appPath: "./api/share.js",
|
||||
}),
|
||||
],
|
||||
});
|
||||
vitePluginNode[0].apply = "serve";
|
||||
|
||||
export default {
|
||||
build: {
|
||||
minify: "terser",
|
||||
terserOptions: { ecma: 5 },
|
||||
sourcemap: "true",
|
||||
},
|
||||
plugins: [legacy(), ...vitePluginNode],
|
||||
};
|
||||
|
|
Reference in a new issue