Hi, im using demo1 app for my personal use, i downloaded it and made a lot of changes(added new pages etc)
So Im trying to export this project for publish
vite.config.ts file
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
base: "/metronic8/react/demo1/",
build: {
chunkSizeWarningLimit: 3000,
},
})
Then I run this command
npm run build
..
dist/assets/WidgetsPage-bb75ee96.js 193.01 kB â gzip: 14.57 kB
dist/assets/index-ec788f2a.js 2,700.60 kB â gzip: 744.17 kB
â built in 27.99s
it gots success, but in dist/index.html file is almost empty, can see anything but
Keenthemes dark logo Keenthemes light logo
Loading...
this,
I can see everything with this command
npm run preview
Hi,
Thank you for reaching out to us.
It sounds like you are trying to deploy your application, to test the production build locally you should run npm run build to build an application, the build output will be placed in dist folder in the root of your project, then to preview production build you can run npm run preview
. Later dist folder can be deployed to our server.
By default, our previews are served under /metronic8/react/demo1/
, when you deploy Metronic on your server, you should update base property up to the path on your server in file vite.config.js. If you do not have a nested folder on your server then you can set base path to /
.
You can read more about this property in the official documentation: https://vitejs.dev/guide/build#public-base-path.
Regards,
Lauris Stepanovs,
Keenthemes Support Team
Hi, I tryed this
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
base: "/",
build: {
chunkSizeWarningLimit: 3000,
},
});
it exports himself but, index.html is not shows anything, how can I share screenshot, I need helpimport { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
base: "/",
build: {
chunkSizeWarningLimit: 3000,
},
});
I uploaded the ss with lightshot
https://prnt.sc/4Tq4yfnT3bee
https://prnt.sc/WioA8Bqq8N6T
Hi,
Thank you for reaching out to us.
You cannot open index.html due to the way modern JavaScript frameworks handle development and deployment.
For the development to run the application you have to use the command npm run dev
, for production use npm run build
.
Regards,
Lauris Stepanovs,
Keenthemes Support Team
You cannot open index.html due to the way modern JavaScript frameworks handle development and deployment.
I'm trying this after the deployment
I really need help, can we connect ?
Please check this out
https://keremmm.netlify.app/
Hi,
It looks like your application just refers to the index.html file directly, which is not correct. Please see this official guide on how you can deploy Vite Vue application to Netify.
https://vitejs.dev/guide/static-deploy#netlify
Regards,
Lauris Stepanovs,
Keenthemes Support Team
ailed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
Hi,
Unfortunately, we were not able to reproduce this error in the latest Metroinc 8 version.
You can try solution suggested in this post: https://stackoverflow.com/questions/75433591/failed-to-load-module-script-expected-a-javascript-module-script-but-the-server
Regards,
Lauris Stepanovs,
Keenthemes Support Team