New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vite build
does not bundle the dependencies
#90
Comments
it is solved? i've the same problem |
A swc plugin is needed. You can replace esbuild builder for swc: npm install -D @swc/core or any adapter for esbuild |
After this modification, there is still no solution package.json {
"name": "fastify-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "vite",
"tsc": "tsc && node dist/tsc/app.js",
"build": "vite build"
},
"type": "module",
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@fastify/type-provider-typebox": "^4.0.0",
"@sinclair/typebox": "^0.32.20",
"fastify": "^4.26.2"
},
"devDependencies": {
"@swc/core": "^1.4.14",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
"typescript": "^5.4.5",
"vite": "^4.5.3",
"vite-plugin-node": "^3.1.0"
}
} export default defineConfig((config) => {
return {
server: {
port: 3000,
host: "0.0.0.0",
},
base: "./",
build: {
target: "node18",
minify: "esbuild",
sourcemap: "inline",
emptyOutDir: true,
},
optimizeDeps: {
esbuildOptions: { treeShaking: true },
},
plugins: [
...VitePluginNode({
adapter: "fastify",
appPath: "src/main.ts",
exportName: "app",
tsCompiler: "swc",
}),
],
};
}); I need help |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's quite clear in the title. No matter what I do, it just won't bundle. I can't even find a place to specify
bundle: true
.vite.config.ts
:package.json
(scripts):And the command output if that's needed:
The text was updated successfully, but these errors were encountered: