-
Notifications
You must be signed in to change notification settings - Fork 660
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
deploying the project #5
Comments
Just use the same npm command lines as usual ( |
you can deploy this project using surge,if you are using vite js with three.js then first u need to run npm build,and after installing surge(its very easy to deploy webpage using it,tutorial is 2 minute video) you deploy the dist folder,so everything works fine |
yes i copy pasted the answer,but the issue is so popular so i had to do it |
I am using surge, but I stilll keep on seeing the HTML text. It doesn't display the 3D objects or animations or even the text in right format. What can I do? |
Just use the same npm command lines as usual (npm install, npm run dev) via SSH if you have credentials |
@Tfc538 hi, thanks for the answer. I ran into this same problem when it comes to deploying the site. I also tried to load a stl file externally instead of creating one. I can view the stl file (external one) fine on my localhost after running |
@young-oct can you please ping me here again in about 3-4 hours? I'm not home right now. |
@Tfc538 , no rush and I appreciate you offer to take a look. whenever you have time, feel free to check out this |
@young-oct do you still need help? I kinda got stuck on a issue myself and forgot about your issues… |
@Tfc538 ,No worries, I’ve managed to figure it out! I encountered a bit of a hiccup with my project structure, but after some tweaking, I resolved the issue. I think it could be helpful for others who might run into a similar situation, so I'm sharing my Vite configuration here as well as my project structure. └───src
│ index.html
│ └───js
│ │ script.js
├── css/
│ └── style.css
└───public
│ └── image.png import { defineConfig } from "vite";
import fs from "fs";
import path from "path";
// Ensure proper plugins are imported, if any are used
export default defineConfig({
root: path.resolve(__dirname, "src"),
base: "/", // Default setting
publicDir: path.resolve(__dirname, "public"),
// Development server configuration
server: {
port: 3000,
host: "localhost",
https: false,
},
// Production build configuration
build: {
chunkSizeWarningLimit: 1000,
assetsDir: "assets", // Specify a directory within `dist` for better organization
outDir: path.resolve(__dirname, "dist"), // Ensure the output directory is correctly resolved
minify: "esbuild", // Use 'esbuild' for faster minification
cssCodeSplit: true,
assetsInlineLimit: 4096,
sourcemap: false,
// Adjusting rollupOptions to better handle input and output settings
rollupOptions: {
input: {
...Object.fromEntries(
fs
.readdirSync(path.resolve(__dirname, "src"))
.filter((file) => file.endsWith(".html"))
.map((file) => [path.basename(file, ".html"), path.resolve(__dirname, "src", file)])
),
script: path.resolve(__dirname, "src/js/script.js"),
},
output: {
entryFileNames: "assets/[name].[hash].js",
chunkFileNames: "assets/[name].[hash].js",
assetFileNames: "assets/[name].[hash][extname]",
},
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
// Add more aliases as needed
},
},
}); |
Great that you solved it! I think its kinda weird that this issue is opened for 3 years now @RaghdanA |
@fireship-io do you mind closing this issue? |
I am trying to deploy the same structure of the project on github, but I am not able to do so. In most cases, it's only showing the HTML file of the project. How can you deploy the same project on GitHub or any other servers?
The text was updated successfully, but these errors were encountered: